web.input unicode conversion should be on by default

Bug #288753 reported by Aaron Swartz
2
Affects Status Importance Assigned to Milestone
web.py
Fix Released
Undecided
Anand Chitipothu

Bug Description

Right now web.input returns bytestrings by default and only converts to Unicode if you explicitly ask it. It should be the reverse, just as it is with files in Python 3.0. Right now people will write code that appears to work fine, then as soon as someone enters a Unicode character in their form, everything crashes. That's basically the worst-case scenario.

Aaron Swartz (aaronsw)
Changed in webpy:
assignee: nobody → anandology
status: New → Confirmed
Revision history for this message
Anand Chitipothu (anandology) wrote : Re: [Bug 288753] [NEW] web.input unicode conversion should be on by default

On Fri, Oct 24, 2008 at 8:27 PM, Aaron Swartz <email address hidden> wrote:
> Public bug reported:
>
> Right now web.input returns bytestrings by default and only converts to
> Unicode if you explicitly ask it. It should be the reverse, just as it
> is with files in Python 3.0. Right now people will write code that
> appears to work fine, then as soon as someone enters a Unicode character
> in their form, everything crashes. That's basically the worst-case
> scenario.

I have added this some time back and reverted because it was also
trying to encode even file uploads.
I need to give it another try.

Revision history for this message
Aaron Swartz (aaronsw) wrote :

> I have added this some time back and reverted because it was also
> trying to encode even file uploads.

I understand; what I'm saying is add an option for _unicode=False for
the file-upload people or something. They're much rarer and more
obvious so the burden should be on then.

Revision history for this message
Anand Chitipothu (anandology) wrote :

fixed.

unicode conversion can be disabled by passing _unicode=False to web.input.

Changed in webpy:
milestone: none → 0.3
status: Confirmed → Fix Committed
Changed in webpy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.