Opened 16 years ago
Closed 13 years ago
#11334 closed Bug (duplicate)
Django fails to show non-latin exception messages from PostgreSQL running on FastCGI
Reported by: | Loststylus | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 1.1-beta |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Run django via FastCGI (used nginx 0.6.x to deploy) with PosgreSQL. Try to execute some query, that will produce an error. If the error returned by PosgreSQL is not latin (Russian in my case), django tries to render an error page, but fails. nginx return a page with "Unhandled exception"
If you turn on debug in flup, you will see the traceback, that shows that django tries to force_unicode the error message and fails with UnicodeDecodeError, so the user cannot determine the problem.
I'll attach a flup error page with stack trace.
Attachments (1)
Change History (10)
by , 16 years ago
Attachment: | flup_stack_trace.html added |
---|
comment:1 by , 16 years ago
Summary: | Django fails to show non-latin exception messages from PosgreSQL running on FastCGI → Django fails to show non-latin exception messages from PostgreSQL running on FastCGI |
---|
comment:2 by , 16 years ago
Component: | Uncategorized → Core framework |
---|
comment:3 by , 15 years ago
Version: | 1.0 → 1.1-beta-1 |
---|
comment:4 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:5 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:8 by , 13 years ago
For better readability, here is the traceback contained in the attached html error page:
Traceback (most recent call last): File "/var/lib/python-support/python2.6/flup/server/fcgi_base.py", line 558, in run protocolStatus, appStatus = self.server.handler(self) File "/var/lib/python-support/python2.6/flup/server/fcgi_base.py", line 1116, in handler result = self.application(environ, start_response) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 239, in __call__ response = self.get_response(request) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 128, in get_response return self.handle_uncaught_exception(request, resolver, exc_info) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 148, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "/usr/local/lib/python2.6/dist-packages/django/views/debug.py", line 39, in technical_500_response html = reporter.get_traceback_html() File "/usr/local/lib/python2.6/dist-packages/django/views/debug.py", line 97, in get_traceback_html 'exception_value': smart_unicode(self.exc_value, errors='replace'), File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py", line 35, in smart_unicode return force_unicode(s, encoding, strings_only, errors) File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py", line 70, in force_unicode raise DjangoUnicodeDecodeError(s, *e.args) DjangoUnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128). You passed in ProgrammingError('\xd0\x92\xd1\x8b\xd1\x80\xd0\xb0\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xb8\xd1\x8f SELECT DISTINCT ON \xd0\xb4\xd0\xbe\xd0\xbb\xd0\xb6\xd0\xbd\xd1\x8b \xd1\x81\xd0\xbe\xd0\xb2\xd0\xbf\xd0\xb0\xd0\xb4\xd0\xb0\xd1\x82\xd1\x8c \xd1\x81 \xd0\xb8\xd0\xb7\xd0\xbd\xd0\xb0\xd1\x87\xd0\xb0\xd0\xbb\xd1\x8c\xd0\xbd\xd1\x8b\xd0\xbc\xd0\xb8 \xd0\xb2\xd1\x8b\xd1\x80\xd0\xb0\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xb8\xd1\x8f\xd0\xbc\xd0\xb8 ORDER BY\n',) (<class 'psycopg2.ProgrammingError'>)
comment:9 by , 13 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This is quite certainly a duplicate of #12302, which should be fixed.
Flup stack trace for the django's debug system unicode decode error