Skip to content
Permalink
Browse files

Device sync: Use defensive encoding (bug 1097)

Make sure that we always use the system default
encoding for file and folder names in order to
avoid encoding errors on certain systems.
  • Loading branch information
thp committed Aug 23, 2010
1 parent 231c31c commit 060ba862ddb6f9d484f86c94f69a14bf1ee542e5
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/gpodder/sync.py
@@ -558,6 +558,8 @@ def add_track(self, episode):
else:
folder = self.destination

folder = util.sanitize_encoding(folder)

from_file = util.sanitize_encoding(self.convert_track(episode))
filename_base = util.sanitize_filename(episode.sync_filename(self._config.custom_sync_name_enabled, self._config.custom_sync_name), self._config.mp3_player_max_filename_length)

@@ -569,7 +571,7 @@ def add_track(self, episode):
if os.path.splitext(to_file)[0] == '':
to_file = os.path.basename(from_file)

to_file = os.path.join(folder, to_file)
to_file = util.sanitize_encoding(os.path.join(folder, to_file))

if not os.path.exists(folder):
try:

0 comments on commit 060ba86

Please sign in to comment.
You can’t perform that action at this time.