Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fwd: Debian Bug#42318: urllib.py has problems with malformed proxy env. variables (PR#59) #32849

Closed
anonymous mannequin opened this issue Aug 1, 2000 · 5 comments
Closed
Labels
OS-windows type-feature A feature request or enhancement

Comments

@anonymous
Copy link
Mannequin

anonymous mannequin commented Aug 1, 2000

BPO 210849
Nosy @tim-one

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2009-12-29.01:49:26.782>
created_at = <Date 2000-08-01.21:16:33.000>
labels = ['type-feature', 'OS-windows']
title = 'Fwd: Debian Bug#42318: urllib.py has problems with malformed proxy env. variables (PR#59)'
updated_at = <Date 2009-12-29.01:49:26.782>
user = 'https://bugs.python.org/anonymous'

bugs.python.org fields:

activity = <Date 2009-12-29.01:49:26.782>
actor = 'shinnosuke'
assignee = 'jhylton'
closed = True
closed_date = None
closer = None
components = ['Windows']
creation = <Date 2000-08-01.21:16:33.000>
creator = 'anonymous'
dependencies = []
files = []
hgrepos = []
issue_num = 210849
keywords = []
message_count = 5.0
messages = ['820', '821', '822', '823', '96983']
nosy_count = 3.0
nosy_names = ['tim.peters', 'jhylton', 'shinnosuke']
pr_nums = []
priority = 'low'
resolution = 'later'
stage = None
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue210849'
versions = ['Python 2.6']

@nobody
Copy link
Mannequin

nobody mannequin commented Aug 1, 2000

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

@anonymous anonymous mannequin added the stdlib Python modules in the Lib dir label Aug 1, 2000
@anonymous anonymous mannequin closed this as completed Aug 1, 2000
@anonymous anonymous mannequin assigned jhylton Aug 1, 2000
@anonymous anonymous mannequin added type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Aug 1, 2000
@anonymous anonymous mannequin closed this as completed Aug 1, 2000
@anonymous anonymous mannequin assigned jhylton Aug 1, 2000
@anonymous anonymous mannequin added the type-feature A feature request or enhancement label Aug 1, 2000
@jhylton
Copy link
Mannequin

jhylton mannequin commented Sep 7, 2000

Please do triage on this bug.

@tim-one
Copy link
Member

tim-one commented Sep 15, 2000

Assigned to Barry because I think of him as being the Potato Man.

@jhylton
Copy link
Mannequin

jhylton mannequin commented Oct 2, 2000

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.

@shinnosuke
Copy link
Mannequin

shinnosuke mannequin commented Dec 29, 2009

I found a solution of the same errors from Windows, and my solution was
removed the double quote at HTTP_PROXY settings.

@shinnosuke shinnosuke mannequin added OS-windows and removed stdlib Python modules in the Lib dir labels Dec 29, 2009
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant