Hi;
I'm getting errors when using urllib2 on my N95 with v1.9.0 - urllib works fine:
but urllib2 always gives me errors:Code:>>> import urllib >>> file = urllib.urlopen("http://news.bbc.co.uk/") >>> file.close()
I can probably rework my code to use urllib, but as I want to use http auth, it's a pain having to write the headers by hand and urllib2 makes life a lot easier :-/Code:>>> import urllib2 >>> file = urllib2.urlopen("http://news.bbc.co.uk/") Traceback (most recent call last): File "<input>", line 1, in <module> File "c:\resource\python25\urllib2.py", line 121, in urlopen return _opener.open(url, data) File "c:\resource\python25\urllib2.py", line 374, in open response = self._open(req, data) File "c:\resource\python25\urllib2.py", line 392, in _open '_open', req) File "c:\resource\python25\urllib2.py", line 353, in _call_chain result = func(*args) File "c:\resource\python25\urllib2.py", line 1100, in http_open return self.do_open(httplib.HTTPConnection, req) File "c:\resource\python25\urllib2.py", line 1089, in do_open fp = socket._fileobject(r, close=True) TypeError: __init__() got an unexpected keyword argument 'close' >>>
Does this look familiar/expected/unexpected to anyone?

Reply With Quote



