Opened 18 years ago
Closed 17 years ago
#4336 closed (wontfix)
Error when I add a "Poll" (from the tutorial) with the settings.py/language="fr"
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | 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
The Admin Interface fails to add object if the settings.py Language="fr". If I switch the language to the default "en-us" I can add a record. It seems that this is due to french character like "éàè".
Here it is an extract to traceback:
Warning at /admin/dj_survey/survey/add/
Data truncated for column 'message' at row 1
Request Method: POST
Request URL: http://localhost:8000/admin/dj_survey/survey/add/
Exception Type: Warning
Exception Value: Data truncated for column 'message' at row 1
Exception Location: /usr/lib/python2.5/warnings.py in warn_explicit, line 102
Traceback (innermost last)
Switch to copy-and-paste view
- /media/My Book/work/web_development/svn_views/django/core/handlers/base.py in get_response
- # Apply view middleware
- for middleware_method in self._view_middleware:
- response = middleware_method(request, callback, callback_args, callback_kwargs)
- if response:
- return response 75.
- try:
- response = callback(request, *callback_args, callback_kwargs) ...
- except Exception, e:
- # If the view raised an exception, run it through exception
- # middleware, and if the exception middleware returns a
- # response, use that. Otherwise, reraise the exception.
- for middleware_method in self._exception_middleware:
- response = middleware_method(request, e)
Change History (7)
comment:1 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 17 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Is still get that kind of error when I use trunk today with language de-de
follow-up: 6 comment:3 by , 17 years ago
I have the same problem.
In settings.LANGUAGE_CODE I have tested 'it-IT', 'it-it', 'it', 'it_it', 'it_IT'.
Django trunk r6094, MySQLdb 1.2.2 final, MySQL 5.0.37.
Same problem if I change the table collation to utf-8.
Request Method: POST Request URL: http://localhost:8000/admin/flatpages/flatpage/add/ Exception Type: Warning Exception Value: Data truncated for column 'message' at row 1 Exception Location: /usr/lib/python2.5/warnings.py in warn_explicit, line 102 Python Executable: /usr/bin/python Python Version: 2.5.1
A solution that may help: set the default encoding to utf8_unicode_ci when you create the database, before the first syncdb.
Davide "Design" Muzzarelli
comment:5 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:6 by , 17 years ago
Replying to reg@dav-muz.net:
A solution that may help: set the default encoding to utf8_unicode_ci when you create the database, before the first syncdb.
really helped - thanks. I've just changed in database dump all charsets and collations to ut8
comment:7 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
This ultimately seems to be a symptom of MySQL tables which were created with a charset/collation that can't handle UTF-8 or the result of translating UTF-8 into the active charset/collation. As such it's really outside the scope of Django -- getting the DB setup wrong is something we can't really help with.
Non-ASCII input is not supported on Django trunk. That is being remedied in the UnicodeBranch. This problem has been fixed there already.
Closing as "invalid", although it really is a valid bug -- there's no other accurate resolution.