Message128922
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.)
-----------------------------
import urllib, urllib.request, urllib.error, urllib.parse
form = urllib.parse.urlencode({'field1':'Log in'})
try:
response = urllib.request.urlopen('http://www.google.com/', form)
except urllib.error.HTTPError as exception:
print (exception)
---------------------------------------
When loaded, the following error messages are generated:
---------------------------------------
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/urllib/request.py", line 1057, in do_request_
mv = memoryview(data)
TypeError: cannot make memory view because object does not have the buffer interface
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/urllib/request.py", line 138, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/urllib/request.py", line 364, in open
req = meth(req)
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/urllib/request.py", line 1062, in do_request_
data))
ValueError: Content-Length should be specified for iterable data of type <class 'str'> 'field1=Log+in'
------------------------------------ |
|
Date |
User |
Action |
Args |
2011-02-20 22:07:31 | david193 | set | recipients:
+ david193 |
2011-02-20 22:07:31 | david193 | set | messageid: <1298239651.85.0.222287222979.issue11261@psf.upfronthosting.co.za> |
2011-02-20 22:07:29 | david193 | link | issue11261 messages |
2011-02-20 22:07:29 | david193 | create | |
|