Message136043
I have the same problem as the original submitter.
The reason it previously worked for you was probably because you didn't utilize a "right" unicode string in the urllib2.request. The following code will raise the exception (I enclose the data file for completeness, but it fails with basically any binary data).
It works fine with Python 2.6.6, but fails with Python 2.7.1.
{{{
import urllib2
f = open("data", "r")
mydata = f.read()
f.close()
#this fails
url=unicode('http://localhost/test')
#this works
#url=str('http://localhost/test')
#this also works
#url=unicode('http://localhost')
req = urllib2.Request(url, data=mydata)
urllib2.urlopen(req)
}}} |
|
Date |
User |
Action |
Args |
2011-05-15 18:30:00 | Jiri.Horky | set | recipients:
+ Jiri.Horky, terry.reedy, orsenthil, bero, ezio.melotti, eric.araujo, santoso.wijaya |
2011-05-15 18:30:00 | Jiri.Horky | set | messageid: <1305484200.4.0.764261304288.issue11898@psf.upfronthosting.co.za> |
2011-05-15 18:29:59 | Jiri.Horky | link | issue11898 messages |
2011-05-15 18:29:59 | Jiri.Horky | create | |
|