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 jweber
Recipients jweber, ronaldoussoren
Date 2009-10-03.03:30:52
SpamBayes Score 9.924637e-06
Marked as misclassified No
Message-id <1254540655.1.0.243210284724.issue7044@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 2.6.3 on Mac OS 10.6.1, there is a bug in 
lib/python2.6/urllib.py, line 1367. The variable hostIP is used before 
it's defined. You can fix it by adding "hostIP = None" at around line 
1355. I got the following exception when calling urllib.urlopen using a 
proxy:

  File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.
py", line 87, in urlopen
    return opener.open(url)
  File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.
py", line 206, in open
    return getattr(self, name)(url)
  File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.
py", line 317, in open_http
    if proxy_bypass(realhost):
  File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.
py", line 1398, in proxy_bypass
    return proxy_bypass_macosx_sysconf(host)
  File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.
py", line 1367, in proxy_bypass_macosx_sysconf
    if hostIP is None:
UnboundLocalError: local variable 'hostIP' referenced before assignment
History
Date User Action Args
2009-10-03 03:30:55jwebersetrecipients: + jweber, ronaldoussoren
2009-10-03 03:30:55jwebersetmessageid: <1254540655.1.0.243210284724.issue7044@psf.upfronthosting.co.za>
2009-10-03 03:30:53jweberlinkissue7044 messages
2009-10-03 03:30:52jwebercreate