gPodder Bug Tracker – Bug 1638
Rename script can't handle filenames with '/'
Last modified: 2012-08-09 19:22:01 BST
If the new filename contains slashes, the script fails to rename as it is interpreted as directory specifier.
put file "$PATH/A46574.mp3" should be renamed in "$PATH/Episode 2012/08/1.mp3": then "Episode 2012/08/1.mp3", the new file name, is interpreted as a directory, which gives a runtime python error (no such file or directory).
I am not very good at python programming, but I quickly added this at line 41:
new_basename = new_basename.replace(" ", "_").replace("/", "-").replace("`", "_")
The function gpodder.util.sanitize_filename() already takes care of converting "/" to "_", and should very likely be used by the extension module to have the best possible filename sanitization (and benefit from future improvements to that function).
Bernd, can you prepare a patch?
Yes, I will prepare a patch in the evening.
I want to work through the list of outstanding extension issues anyway :-)
@thp: send you the pull request on github
(In reply to comment #3)
> @thp: send you the pull request on github
Merged. Can this bug be closed now? :)
yes, I close it.