This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urllib2 tests pass
Type: Stage:
Components: Library (Lib) Versions: Python 3.0
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum, hdiwan650
Priority: normal Keywords: patch

Created on 2007-07-16 21:27 by hdiwan650, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
urllib2.pat hdiwan650, 2007-07-16 21:27 Patch to make all tests pass on urllib2
test_urllib2.pat hdiwan650, 2007-07-16 21:51
test_urllib2.pat hdiwan650, 2007-07-16 22:19 Patch to make all tests pass on urllib2 -- incorporating Guido's fix
Messages (5)
msg52888 - (view) Author: Hasan Diwan (hdiwan650) Date: 2007-07-16 21:27
Tests pass for urllib2
msg52889 - (view) Author: Hasan Diwan (hdiwan650) Date: 2007-07-16 21:51
File Added: test_urllib2.pat
msg52890 - (view) Author: Hasan Diwan (hdiwan650) Date: 2007-07-16 22:19
File Added: test_urllib2.pat
msg52891 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-07-17 20:56
With the latest version I still get three errors: test_basic_and_digest_auth_handlers, test_basic_auth, test_proxy_basic_auth, all failing here: 

  File "Lib/test/test_urllib2.py", line 990, in _test_basic_auth
    r = opener.open(request_url)
  File "/usr/local/google/home/guido/python/py3k-struni/Lib/urllib2.py", line 374, in open
    response = self._open(req, data)
  File "/usr/local/google/home/guido/python/py3k-struni/Lib/urllib2.py", line 392, in _open
    '_open', req)
  File "/usr/local/google/home/guido/python/py3k-struni/Lib/urllib2.py", line 352, in _call_chain
    result = func(*args)
  File "Lib/test/test_urllib2.py", line 363, in http_open
    "http", req, MockFile(), self.code, name, msg)
  File "/usr/local/google/home/guido/python/py3k-struni/Lib/urllib2.py", line 412, in error
    result = self._call_chain(*args)
  File "/usr/local/google/home/guido/python/py3k-struni/Lib/urllib2.py", line 352, in _call_chain
    result = func(*args)
  File "/usr/local/google/home/guido/python/py3k-struni/Lib/urllib2.py", line 831, in http_error_407
    authority, req, headers)
  File "/usr/local/google/home/guido/python/py3k-struni/Lib/urllib2.py", line 795, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/local/google/home/guido/python/py3k-struni/Lib/urllib2.py", line 801, in retry_http_basic_auth
    auth = 'Basic %s' % base64.b64encode(raw).strip()
TypeError: strip() takes exactly one argument (0 given)

Also:

(1) I'd like to see the interact_netscape call fixed rather than commented out

(2) I wonder if urllib shouldn't use text strings instead of bytes for headers and values.
msg52892 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-08-03 19:21
A different patch, by Joe Gregorio, was committed that fixes this in differently.
History
Date User Action Args
2022-04-11 14:56:25adminsetgithub: 45209
2008-01-06 22:29:45adminsetkeywords: - py3k
versions: + Python 3.0
2007-07-16 21:27:00hdiwan650create