Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 1125001: ordinal not in range(128) #1

Closed
giveortake opened this issue Apr 17, 2020 · 1 comment

Comments

@giveortake
Copy link

giveortake commented Apr 17, 2020

Hi there,

Thank you for creating this script, it is exactly what I need. I have run into an issue after install regarding encoding. Here are the details:

Fri Apr 17 2020 10:03:38 | Post-process-script GetScripts/nzbbacktoQ.py for mynzbfile failed (terminated with unknown status)

INFO | Fri Apr 17 2020 10:03:38 | nzbbacktoQ: UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 1125001: ordinal not in range(128)
INFO | Fri Apr 17 2020 10:03:38 | nzbbacktoQ: nzbid = server.append(filename, base64.b64encode(nzb.encode('utf8')).decode('ascii'), category, 0, True, False, '', 0, 'ALL', [('*unpack:password', nzbpassword)])
INFO | Fri Apr 17 2020 10:03:38 | nzbbacktoQ: File "/volume1/@appstore/nzbget/share/nzbget/scripts/GetScripts/nzbbacktoQ.py", line 62, in addLocalFileToNZBGet
INFO | Fri Apr 17 2020 10:03:38 | nzbbacktoQ: nzbid = addLocalFileToNZBGet(nzbname + '.nzb', nzbpath, nzbcategory, nzbpassword)
INFO | Fri Apr 17 2020 10:03:38 | nzbbacktoQ: File "/volume1/@appstore/nzbget/share/nzbget/scripts/GetScripts/nzbbacktoQ.py", line 101, in
INFO | Fri Apr 17 2020 10:03:38 | nzbbacktoQ: Traceback (most recent call last):
INFO | Fri Apr 17 2020 10:03:38 | nzbbacktoQ: Found NZB file "mynzbfile"
INFO | Fri Apr 17 2020 10:03:38 | Executing post-process-script GetScripts/nzbbacktoQ.py for mynzbfile

let me know if you need more details, I can also share the nzb with you. Best regards.

@giveortake
Copy link
Author

fixed by adding

reload(sys)
sys.setdefaultencoding('latin1')

at line 31 (under import sys)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant