Opened 8 years ago

Closed 7 years ago

#5112 closed (wontfix)

Unicode recipients in settings ADMINS and MANAGERS

Reported by: zodi Owned by: nobody
Component: django-admin.py runserver Version: master
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: UI/UX:

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@…> 8 years ago.
UnicodeDecodeError

Download all attachments as: .zip

Change History (5)

comment:1 follow-up: Changed 8 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 in reply to: ↑ 1 Changed 8 years ago by zodi <zodizz@…>

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?

Changed 8 years ago by zodi <zodizz@…>

UnicodeDecodeError

comment:3 Changed 8 years ago by zodi

  • Component changed from Documentation to django-admin.py runserver
  • Owner changed from jacob to adrian

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 Changed 7 years ago by jacob

  • Resolution set to wontfix
  • Status changed from new to 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