posborne / putio-sync

Python daemon that automatically downloads files from put.io
MIT License
29 stars 12 forks source link

Unicode issue with python2 #45

Open alasdaircr opened 7 years ago

alasdaircr commented 7 years ago

When running under python2.7 you crash when encountering a filename with a unicode symbol in it.

Exception in thread DownloadManager:                | ETA:  --:--:--   0.00 B/s
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/putiosync/download_manager.py", line 224, in run
    success = download.perform_download(self._token)
  File "/usr/local/lib/python2.7/dist-packages/putiosync/download_manager.py", line 101, in perform_download
    download_path = "{}.part".format(final_path)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0301' in position 112: ordinal not in range(128)
mihaerzen commented 6 years ago

I created a pull request which fixes this issue. #47

joshkerr commented 5 years ago

Was this issue released to the version on PIP? I seem to still be getting this error.