validate:launcher: escape the characters to remove bad range in regex

When media file name consists of some special characters of the format
[b-a].mp3, then it fails with 'bad character range' error and exits.
call re.escape to escape the characters before using it in findall

https://bugzilla.gnome.org/show_bug.cgi?id=752650
This commit is contained in:
Vineeth TM 2015-07-22 08:45:26 +09:00 committed by Nicolas Dufresne
parent ac172a9ac6
commit 94c684d401

View file

@ -1371,7 +1371,7 @@ class ScenarioManager(Loggable):
mfile_bname = os.path.basename(mfile)
for f in os.listdir(os.path.dirname(mfile)):
if re.findall("%s\..*\.%s$" % (mfile_bname, self.FILE_EXTENSION), f):
if re.findall("%s\..*\.%s$" % (re.escape(mfile_bname), self.FILE_EXTENSION), f):
scenarios.append(os.path.join(os.path.dirname(mfile), f))
if scenarios: