This repository has been archived by the owner on Nov 18, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I just ran into issues with the Email.py script that postprocessing failed because of errors like this:
Wed Nov 28 2018 01:20:01 DETAIL EMail: Script successfully started
Wed Nov 28 2018 01:20:01 INFO EMail: Traceback (most recent call last):
Wed Nov 28 2018 01:20:01 INFO EMail: File "/downloads/scripts/EMail.py", line 245, in
Wed Nov 28 2018 01:20:01 INFO EMail: msg = MIMEText(text)
Wed Nov 28 2018 01:20:01 INFO EMail: File "/usr/lib/python2.7/email/mime/text.py", line 30, in init
Wed Nov 28 2018 01:20:01 INFO EMail: self.set_payload(_text, _charset)
Wed Nov 28 2018 01:20:01 INFO EMail: File "/usr/lib/python2.7/email/message.py", line 226, in set_payload
Wed Nov 28 2018 01:20:01 INFO EMail: self.set_charset(charset)
Wed Nov 28 2018 01:20:01 INFO EMail: File "/usr/lib/python2.7/email/message.py", line 262, in set_charset
Wed Nov 28 2018 01:20:01 INFO EMail: self._payload = self._payload.encode(charset.output_charset)
Wed Nov 28 2018 01:20:01 INFO EMail: UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 27060: ordinal not in range(128)
I identified german umlauts and some other non ascii characters beeing the cause of these errors. I did some research and found out to avoid errors like this it's best practice to perform a proper encoding of the email body.
In my own environment (nzbget is running in docker on Synology NAS with DSM 6.2) where python sys.getdefaultencoding() is "ascii", everything is working fine again.
Cheers,
Jürgen