[New-bugs-announce] [issue11261] urlopen breaks when data parameter is used.

Senthil Kumaran orsenthil at gmail.com
Mon Feb 21 02:50:54 CET 2011


On Sun, Feb 20, 2011 at 10:07:31PM +0000, David Phillips wrote:

> The following code works on python 3.1.3 but fails on Python 3.2rc2
> (r32rc2:88269, Jan 30 2011, 14:30:28). (I run Mac OS X, version
> 10.6.6.)

Is that a real world code? (As in used in production)?  Because,
things have been a bit tightened in 3.2 and it expects data to be
bytes and throws an exception if it is not bytes.

urlencode will output str and you have explicitly encode it to bytes
(Using the value Accept-Encoding response header) before you send the
data to urlopen. The updated docs reflect this change.


More information about the New-bugs-announce mailing list