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: Fwd: Debian Bug#42318: urllib.py has problems with malformed proxy env. variables (PR#59)
Type: enhancement Stage:
Components: Windows Versions: Python 2.6
process
Status: closed Resolution: later
Dependencies: Superseder:
Assigned To: jhylton Nosy List: jhylton, shinnosuke, tim.peters
Priority: low Keywords:

Created on 2000-08-01 21:16 by anonymous, last changed 2022-04-10 16:02 by admin. This issue is now closed.

Messages (5)
msg820 - (view) Author: Nobody/Anonymous (nobody) Date: 2000-08-01 21:16
Jitterbug-Id: 59
Submitted-By: flight@debian.org
Date: Fri, 20 Aug 1999 13:40:04 -0400 (EDT)
Version: 1.5.2
OS: Debian potato


Summary: Python's urllib expects a fully qualified URL in HTTP_PROXY (like
"http://proxy:8080/"). Many applications allow short forms in HTTP_PROXY
(like "proxy:8080"). If HTTP_PROXY is set to a short form, urllib.py will
fail with an uncomprehensible error message.


Long form:

Francesco Potorti` <F.Potorti@cnuce.cnr.it> says (in the Debian bug report
http://www.debian.org/Bugs/db/42/42318.html):

  "when setting a proxy variable that is not parsed by urllib, urllib does
   not print a comprehensible error message."

An example:


Short form HTTP_PROXY:

  master% HTTP_PROXY="proxy.cnr.it:8081" \
    python -c 'import urllib; print
urllib.urlretrieve("http://www.olemiss.edu/")'
  Traceback (innermost last):
    File "<string>", line 1, in ?
    File "/usr/lib/python1.5/urllib.py", line 69, in urlretrieve
      return _urlopener.retrieve(url)
    File "/usr/lib/python1.5/urllib.py", line 186, in retrieve
      fp = self.open(url)
    File "/usr/lib/python1.5/urllib.py", line 154, in open
      return self.open_unknown(fullurl)
    File "/usr/lib/python1.5/urllib.py", line 168, in open_unknown
      raise IOError, ('url error', 'unknown url type', type)
  IOError: ('url error', 'unknown url type', 'http')


Fully qualified URL in HTTP_PROXY:

  master% HTTP_PROXY="http://proxy.cnr.it:8081" \
    python -c 'import urllib; print
urllib.urlretrieve("http://www.olemiss.edu/")'
  ('/tmp/@15884.1', <mimetools.Message instance at 80adb08>)



====================================================================
Audit trail:
Mon Aug 30 12:35:03 1999	guido	moved from incoming to request
msg821 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2000-09-07 22:06
Please do triage on this bug.
msg822 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2000-09-15 05:52
Assigned to Barry because I think of him as being the Potato Man.
msg823 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2000-10-02 23:00
The immediate fix for this bug report is to raise a more explanatory error message:
IOError: [Errno url error] invalid proxy for http: 'localhost:3128'

In the long term, we may want to support the requested feature.
Added to PEP 42.
msg96983 - (view) Author: Shinnosuke (shinnosuke) Date: 2009-12-29 01:49
I found a solution of the same errors from Windows, and my solution was
removed the double quote at HTTP_PROXY settings.
History
Date User Action Args
2022-04-10 16:02:14adminsetgithub: 32849
2009-12-29 01:49:26shinnosukesetversions: + Python 2.6
nosy: + shinnosuke

messages: + msg96983

components: + Windows, - Library (Lib)
2000-08-01 21:16:33anonymouscreate