-
Notifications
You must be signed in to change notification settings - Fork 12
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 #81
Comments
As far as I can see the error is not in ZConfig. Something is sent to your log that is not ASCII and the logger blows up on that. |
Yes, indeed, ZConfig could try a bit harder to handle the encoding/decoding problem, so that at least one can see what actually gets there... I'm looking at it, no success so far :) |
Based on the line numbers, ZConfig has already tried decoding twice: ZConfig/ZConfig/components/logger/formatter.py Lines 314 to 324 in 0f26a80
|
I'd start with finding out about the message that causes the issue. You could add some simple print statements before the |
Finally I could get something out of it (and yes, sorry for the short signed me not seeing that ZConfig tires twice to handle UnicodeDecodeError's 😅 ): Turns out that the problem is on With this: derFreitag@0d4ef60 is enough to fix it. Would it be worth a pull request? 🤔 |
I'm not personally a fan of trying to decode the message. That seems to me like a downstream bug, where the caller of the library is confused about what is text and what is bytes (and what is a native string). But I can concede that it might be a pragmatic thing to do, and it only affects the Python 2 formatter, where such things are admittedly easier to confuse. (However, watch out for issues trying to use that code on Python 3.) So I guess my vote would be |
BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)
I see, by the hundreds, on our production servers tracebacks like the following:
As seen, we are using python 2.7 still 😨 and ZConfig 3.5.0.
As that is on formatting logging, it is difficult to log anything around it to see what's the problem 🤷
I will make an internal patch, deploy it on a canary instance and in a few days report back my findings 👍
The text was updated successfully, but these errors were encountered: