Opened 19 years ago

Closed 19 years ago

#5112 closed (wontfix)

Unicode recipients in settings ADMINS and MANAGERS

Reported by: zodi Owned by: nobody
Component: django-admin.py runserver Version: dev
Severity: Keywords: unicode Settings ADMINS MANAGERS
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Following the unicode merge.
​Settings documentation should point out that full names for recipients in ADMINS and MANAGERS must be defined as u'' if it contains none ASCII characters.

If not it causes a tricky UnicodeDecodeError, disabling djangos traceback view and spitting out a plain text error.

(Or should it be considered a bug?)

Attachments (1)

error.txt​ (2.2 KB ) - added by zodi <zodizz@…> 19 years ago.
UnicodeDecodeError

Download all attachments as: .zip

Change History (5)

comment:1 by Malcolm Tredinnick, 19 years ago

Are you saying the UTF-8 encoded bytestring (Python str objects that are UTF-8 encoded) do not work in those places?

in reply to:  1 comment:2 by zodi <zodizz@…>, 19 years ago

Ok now its just getting weirder.

I tried to reproduce the issue with a cleaner project and didn't get the same error until I set the DATABASE_ENGINE just give it a working db and user without running the first syncdb. Seams to be a Mysql issue somehow because sqlite3 works just fine.

Tested with:

  • Win XP
  • Python 2.4.3
  • Django Latest svn
  • Mysql 5.0.41 and 5.0.32 on debian via ssh tunnel

And yes it's the UTF-8 encoded bytestring that seams to be causing it

ADMINS = (
    ('Your Nameåäö', 'your_email@domain.com'),
)

fails

ADMINS = (
    (u'Your Nameåäö', 'your_email@domain.com'),
)

works

And this is the development server I'm testing with. Might just be my configuration?

by zodi <zodizz@…>, 19 years ago

Attachment: error.txt​ added

UnicodeDecodeError

comment:3 by zodi, 19 years ago

Component: Documentation → django-admin.py runserver
Owner: changed from Jacob to Adrian Holovaty

Appears to only cause problems with the development server

And some clarification, the error is triggered when viewing a traceback view for a triggered error.

comment:4 by Jacob, 19 years ago

Resolution: → wontfix
Status: new → closed

If you're using non-ASCII in a Python file, it needs a ​coding declaration like # -*- coding: utf-8 -*-. Without one, you'll get errors like this. Django can't do anything differently here; the problem hits before we get a chance to do anything about it.

Note: See TracTickets for help on using tickets.
Back to Top