JohnDoee / autotorrent

Matches torrents with files and gets them seeded
MIT License
269 stars 34 forks source link

Fix Unicode Encoding Bug #35

Closed impo closed 4 years ago

impo commented 4 years ago

The same bug referenced in issues #20 and #21. autotorrent -r seems to have a hard time handling the unicode in my downloads folder.

adamwinn commented 4 years ago

Yes, unicoding issues need to be fixed. I'm running into this too

Adding filename = filename.decode('utf-8') in normalize_filename() in db.py seems to work

bobbintb commented 4 years ago

Yes, unicoding issues need to be fixed. I'm running into this too

Adding filename = filename.decode('utf-8') in normalize_filename() in db.py seems to work

I got this:

File "/usr/lib64/python3.8/site-packages/autotorrent/db.py", line 288, in normalize_filename filename = filename.decode('utf-8') AttributeError: 'str' object has no attribute 'decode'

Motophan commented 4 years ago

I opened my db.py with nano, but cannot figure out how to apply @adamwinn fix. @bobbintb did this work for you?

bobbintb commented 4 years ago

I opened my db.py with nano, but cannot figure out how to apply @adamwinn fix. @bobbintb did this work for you?

No, it didn't. I think it's because I'm on Python 3. I ended up using Python 2 because it was less of a pain than trying to fix it for something I only needed momentarily.

Motophan commented 4 years ago

@bobbintb how can I add this to the python 2 version ? Id really like to get this working

bobbintb commented 4 years ago

@bobbintb how can I add this to the python 2 version ? Id really like to get this working

I think I just did adamwinn's fix in Python2. It didn't work in Python3.

JohnDoee commented 4 years ago

Thanks for reporting this.

This is folded into #45