PTPAPI icon indicating copy to clipboard operation
PTPAPI copied to clipboard

Unicode not supported

Open scrimpys opened this issue 5 years ago • 3 comments

Noticed number of times python code complains when it encounters UTF-8 characters in the file names.

INFO:ptp-reseed:Starting reseed attempt on file /volume1/Movies/TZ/¡Vivan las Antipodas! (2011) Traceback (most recent call last): File "/usr/local/bin/ptp-reseed", line 10, in sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/ptpapi/scripts/ptp_reseed.py", line 302, in main if not os.path.exists(filename): File "/usr/lib/python2.7/genericpath.py", line 18, in exists os.stat(path) UnicodeEncodeError: 'ascii' codec can't encode character u'\xa1' in position 19: ordinal not in range(128)

scrimpys avatar Sep 20 '19 01:09 scrimpys

This should be fixed in the latest develop branch, can you confirm?

kannibalox avatar Oct 13 '19 02:10 kannibalox

Not sure I upgraded it properly .... did "pip install -U https://github.com/kannibalox/PTPAPI/archive/master.zip" hoping it would upgrade components.

Anyway if it did upgrade it then it is not fixed.

INFO:ptp-reseed:Starting reseed attempt on file "/volume1/Movies/AE/8QK841~2"

INFO:ptpapi.scripts.ptp_reseed:Searching movies by file list

INFO:ptpapi.scripts.ptp_reseed:Guessing name from filepath with guessit

ERROR:ptp-reseed:Could not find an associated torrent for '/volume1/Movies/AE/8QK841~2', cannot reseed

Traceback (most recent call last):

File "/usr/local/bin/ptp-reseed", line 10, in

sys.exit(main())

File "/usr/local/lib/python2.7/dist-packages/ptpapi/scripts/ptp_reseed.py", line 301, in main

logger.info(u'Starting reseed attempt on file "{0}"'.format(filename))

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 20: ordinal not in range(128)

On Sun, Oct 13, 2019 at 10:21 AM kannibalox [email protected] wrote:

This should be fixed in the latest develop branch, can you confirm?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kannibalox/PTPAPI/issues/7?email_source=notifications&email_token=AGARIWIMD4CKOHEZKEW5AM3QOKA3LA5CNFSM4IYRQJV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCMTSQ#issuecomment-541379018, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGARIWNLQWEFZHS5P5WESDLQOKA3LANCNFSM4IYRQJVQ .

scrimpys avatar Oct 13 '19 23:10 scrimpys

I can probably fix that bug, but I have strong doubts about this script being able to effectively match anything against samba-mangled filenames.

kannibalox avatar Oct 14 '19 02:10 kannibalox

There shouldn't be any unicode errors anymore, feel free to re-open with examples if you're still encountering them.

kannibalox avatar Apr 23 '23 00:04 kannibalox