[Python-bugs-list] [Bug #113811] Python 2.0 beta 1 -- urllib.urlopen() fails

noreply@sourceforge.net noreply@sourceforge.net
Thu, 7 Sep 2000 15:02:16 -0700


Bug #113811, was updated on 2000-Sep-07 09:45
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: Python 2.0 beta 1 -- urllib.urlopen() fails

Details: In performing a urllib.urlopen(url) with "url" containing a valid URL, I got the following error message:

Traceback (most recent call last):
  File "IGNRatings.py", line 249, in ?
    main(sys.argv[1:])
  File "IGNRatings.py", line 132, in main
    inStream = urllib.urlopen(url)
  File "E:\Python20\lib\urllib.py", line 61, in urlopen
    return _urlopener.open(url)
  File "E:\Python20\lib\urllib.py", line 163, in open
    return getattr(self, name)(url)
  File "E:\Python20\lib\urllib.py", line 259, in open_http
    h = httplib.HTTP(host)
  File "E:\Python20\lib\httplib.py", line 626, in __init__
    self._conn = self._connection_class(host, port)
  File "E:\Python20\lib\httplib.py", line 325, in __init__
    self._set_hostport(host, port)
  File "E:\Python20\lib\httplib.py", line 332, in _set_hostport
    port = int(host[i+1:])
ValueError: invalid literal for int():


I looked into this a tiny bit and found that HTTPConnection.__init__() is called with host="http:" -- probably not the right thing. Python 1.6 works correctly.

Thanks,
Bob Alexander
bobalex@home.com

Follow-Ups:

Date: 2000-Sep-07 15:02
By: jhylton

Comment:
Please do triage on this bug.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=113811&group_id=5470