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.

Author Andy.Reitz
Recipients Andy.Reitz
Date 2015-01-27.07:28:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Sorry, went a bit too quickly -- here is the sample code that I meant to use:

  import os, urllib2
  os.environ['http_proxy'] = "http://someuser:a/b@"
  f = urllib2.urlopen('')
  data =
  print data

And the stack trace that I receive:

Traceback (most recent call last):
  File "", line 3, in <module>
    f = urllib2.urlopen('')
  File "/usr/lib64/python2.7/", line 154, in urlopen
    return, data, timeout)
  File "/usr/lib64/python2.7/", line 431, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.7/", line 449, in _open
    '_open', req)
  File "/usr/lib64/python2.7/", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/", line 1227, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib64/python2.7/", line 1166, in do_open
    h = http_class(host, timeout=req.timeout, **http_conn_args)
  File "/usr/lib64/python2.7/", line 712, in __init__
    (, self.port) = self._get_hostport(host, port)
  File "/usr/lib64/python2.7/", line 754, in _get_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: 'a'

It actually looks the same -- so I suppose this issue affects both urllib and urllib2.
Date User Action Args
2015-01-27 07:28:54Andy.Reitzsetrecipients: + Andy.Reitz
2015-01-27 07:28:54Andy.Reitzsetmessageid: <>
2015-01-27 07:28:54Andy.Reitzlinkissue23328 messages
2015-01-27 07:28:54Andy.Reitzcreate