[New-bugs-announce] [issue7044] urllib.urlopen crashes when used on Mac OS 10.6.1 through a proxy

jweber report at bugs.python.org
Sat Oct 3 05:30:55 CEST 2009


New submission from jweber <jacob at jacobweber.com>:

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

----------
assignee: ronaldoussoren
components: Macintosh
messages: 93473
nosy: jweber, ronaldoussoren
severity: normal
status: open
title: urllib.urlopen crashes when used on Mac OS 10.6.1 through a proxy
type: crash
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7044>
_______________________________________


More information about the New-bugs-announce mailing list