[ or ] in path should be escaped for cover globbing

Bug #173661 reported by Johannes Sasongko
8
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
High
Unassigned

Bug Description

 affects exaile
 assignee sjohannes
 status inprogress
 importance medium
 milestone 0.2.12

Here's what happens if a file has [ or ] in the path. Will need to check
other globbing chars.

[15:09:28] -----------------------
[15:09:28] play ( /usr/lib/exaile/xl/player.py @ 580):
[15:09:28] -----------------------
[15:09:28] Traceback (most recent call last):
[15:09:28] File "/usr/lib/exaile/xl/player.py", line 605, in play
[15:09:28] self.play_track(track, from_button=True)
[15:09:28] File "/usr/lib/exaile/xl/player.py", line 557, in play_track
[15:09:28] self.exaile.cover_manager.fetch_cover(track)
[15:09:28] File "/usr/lib/exaile/xl/covers.py", line 335, in fetch_cover
[15:09:28] cover = self.fetch_from_fs(track)
[15:09:28] File "/usr/lib/exaile/xl/covers.py", line 374, in fetch_from_fs
[15:09:28] for f in glob.glob(os.path.join(dir, f.strip())):
[15:09:28] File "/usr/lib/python2.5/glob.py", line 15, in glob
[15:09:28] return list(iglob(pathname))
[15:09:28] File "/usr/lib/python2.5/glob.py", line 40, in iglob
[15:09:28] for dirname in dirs:
[15:09:28] File "/usr/lib/python2.5/glob.py", line 41, in iglob
[15:09:28] for name in glob_in_dir(dirname, basename):
[15:09:28] File "/usr/lib/python2.5/glob.py", line 57, in glob1
[15:09:28] return fnmatch.filter(names,pattern)
[15:09:28] File "/usr/lib/python2.5/fnmatch.py", line 47, in filter
[15:09:28] _cache[pat] = re.compile(res)
[15:09:28] File "/usr/lib/python2.5/re.py", line 180, in compile
[15:09:28] return _compile(pattern, flags)
[15:09:28] File "/usr/lib/python2.5/re.py", line 233, in _compile
[15:09:28] raise error, v # invalid expression
[15:09:28] error: bad character range

Revision history for this message
Mathias Brodala (mathbr) wrote :

Proposal; why use glob anyways here?

Revision history for this message
Johannes Sasongko (sjohannes) wrote : [Bug 173661] Re: [ or ] in path should be escaped for cover globbing

> why use glob anyways here?

See bug 136162.

Revision history for this message
Johannes Sasongko (sjohannes) wrote :

I'm not actually working on this at the moment, so changing status and milestone.

Changed in exaile:
milestone: 0.2.12 → none
status: In Progress → Triaged
Revision history for this message
reacocard (reacocard) wrote :

just had this confirmed by another user in IRC. Given that for some users changing the filenames to avoid this issue is not an option, I'm marking this as due for 0.3.0.

Changed in exaile:
importance: Medium → High
milestone: none → 0.3.0
status: Triaged → Confirmed
Revision history for this message
reacocard (reacocard) wrote :

apparently 0.3 already fixed this.

Changed in exaile:
status: Confirmed → Fix Committed
Changed in exaile:
assignee: Johannes Sasongko (sjohannes) → nobody
reacocard (reacocard)
Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.