Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19487 closed Bug (fixed)

WSGI environ contains unicode strings

Reported by: Aymeric Augustin Owned by: nobody
Component: Python 2 Version: dev
Severity: Release blocker 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

PEP 3333 says it should contain native strings (str objects).

This is a regression introduced by the unicode_literals patch. It only affects Python 2.

Change History (6)

comment:1 by Aymeric Augustin, 12 years ago

Pull request fixing this issue as well as #19468: https://github.com/django/django/pull/596

comment:2 by Claude Paroz, 12 years ago

Aymeric, you know my opinion on using settings.DEFAULT_CHARSET to decode URLs. This will work for the majority of people which do not touch this setting. But for those who customized it, Django will still encode the URL's in UTF-8, so the decoding will probably fail. settings.DEFAULT_CHARSET is really about response encoding, not much else (see #4380).

comment:3 by Claude Paroz, 12 years ago

My latest comment affects only the second commit of your PR, of course. First one is probably RFC.

comment:4 by Russell Keith-Magee, 12 years ago

Triage Stage: UnreviewedAccepted

comment:5 by Aymeric Augustin <aymeric.augustin@…>, 12 years ago

Resolution: fixed
Status: newclosed

In db22145afb9623fdcaa4269b5eefa045320e028e:

[1.5.x] Fixed #19487 -- Used str in the test client's WSGI environ.

This regression was introduced by the unicode_literals patch. The WSGI
spec mandates that environ contains native strings.

Backport of d9a0b6a.

comment:6 by Aymeric Augustin <aymeric.augustin@…>, 12 years ago

In d9a0b6ab36b6beb4251acf1de1fdf255e1223e02:

Fixed #19487 -- Used str in the test client's WSGI environ.

This regression was introduced by the unicode_literals patch. The WSGI
spec mandates that environ contains native strings.

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