Closed philspins closed 4 years ago
So, one of the big problems with encoding stuff in autotorrent is that it's both Python 2 and 3 compatible. The way you've solved the issues you've hit broke Python 3 support but that should be fixable though.
Can you include a testcase or two that this pull-request fixes for you ? That's the easiest way to see if it's a python 2 issue only.
I tried writing some test cases but honestly I'm lost as to how to write them.
I'm trying to write a case for a torrent that includes a file called "file-エンドレス.txt" but I can't get shutil to copy it...
f = u'file-\xe3\x82\xa8\xe3\x83\xb3\xe3\x83\x89\xe3\x83\xac\xe3\x82\xb9.txt'
src = os.path.join(dirname, f)
dst = os.path.join(self.src, f)
shutil.copy(src.decode('utf-8'), dst.decode('utf-8'))
Thanks for trying to fix this, I did try your solution originally but it is all related to varying encoding when it comes to Python 2. I've folded all this into #45 and will try to solve it.
I ran into problems when importing some foreign music torrents, so I did a bit of debugging and was able fixe the issues by adding some ".encode('utf-8')" commands.