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
UnicodeError while handling a bug #757
Comments
Please show us code snippet to reproduce this issue. |
Sure, here is an example of web.debugerror.emailerrors_internal() that generates a non unicode char
|
by the way.. because of this error i had to reboot my servers.. Since everytime it tried to send an email it crashed because of the bug, that generates another email to send, so it generated a loop of never sending emails .. |
@Z4nzu It would be helpful if we created a https://github.com/webpy/webpy/tree/master/tests/test_debugerror.py file that contained at least one pytest that failed based on @criptocoko scenarios above but then passed when #762 is merged. That way we would have a test in place to ensure that we never have this problem again. Thoughts? |
I got your point.! Are you talking about creating a test case file for the issue we resolved ? |
Correct. Please look at the other files in |
I'm getting the following error while sending an email when a bug occurs:
ERROR HAPPENS ...
...
..
During handling of the above exception, another exception occurred:
File "/usr/local/lib/python3.10/dist-packages/web/application.py", line 278, in process
return p(lambda: process(processors))
File "/usr/local/lib/python3.10/dist-packages/web/application.py", line 686, in processor
return handler()
File "/usr/local/lib/python3.10/dist-packages/web/application.py", line 278, in
return p(lambda: process(processors))
File "/usr/local/lib/python3.10/dist-packages/web/application.py", line 287, in process
raise self.internalerror()
File "/usr/local/lib/python3.10/dist-packages/web/debugerror.py", line 354, in emailerrors_internal
sendmail(
File "/usr/local/lib/python3.10/dist-packages/web/utils.py", line 1449, in sendmail
mail.send()
File "/usr/local/lib/python3.10/dist-packages/web/utils.py", line 1544, in send
self.send_with_smtp(message_text)
File "/usr/local/lib/python3.10/dist-packages/web/utils.py", line 1592, in send_with_smtp
smtpserver.sendmail(self.from_address, self.recipients, message_text)
File "/usr/lib/python3.10/smtplib.py", line 875, in sendmail
msg = _fix_eols(msg).encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 12430: ordinal not in range(128)
If i add message_text.enconde('ascii", errors="ignore") the problem is fixed but i don't want to patch webpy code.... is there a way to fix this?
The text was updated successfully, but these errors were encountered: