Skip to content

Commit

Permalink
Remove null characters from path names
Browse files Browse the repository at this point in the history
A user reported that their manually-entered genre tags had null
characters at the end, after reloading them into Picard later. It's not
clear if Picard somehow added these, or another program did.
Regardless, using %genre% in the file naming scheme caused saving to
fail. Null characters are now removed from path names before saving.
  • Loading branch information
mwiencek committed May 23, 2012
1 parent ab5e7d5 commit d4a1353
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions picard/file.py
Expand Up @@ -227,6 +227,8 @@ def _script_to_filename(self, format, file_metadata, settings):
if isinstance(filename, unicode):
filename = unaccent(filename)
filename = replace_non_ascii(filename)
# remove null characters
filename = filename.replace("\x00", "")
return filename

def _make_filename(self, filename, metadata, settings):
Expand Down

0 comments on commit d4a1353

Please sign in to comment.