Jiri Horky <jiri.ho...@gmail.com> added the comment: 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) }}} ---------- nosy: +Jiri.Horky Added file: http://bugs.python.org/file22004/data _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11898> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com