Bug 57293 - python 1.5.2 urllib open_http() drops protocol
Summary: python 1.5.2 urllib open_http() drops protocol
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: python
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Brock Organ
URL: http://home.earthlink.net/~joefefifo/...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-12-09 01:54 UTC by Joe Antao
Modified: 2007-04-18 16:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-08-14 16:26:29 UTC
Embargoed:


Attachments (Terms of Use)
patches /usr/lib/python1.5/urllib.py in Red Hat 7.1 and 7.2 (739 bytes, patch)
2001-12-09 01:55 UTC, Joe Antao
no flags Details | Diff

Description Joe Antao 2001-12-09 01:54:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120

Description of problem:
When retrieving a web page using URLopener.open() in urllib, the object
returned is missing the protocol in its 'url' member.

Specifically, the class method open_http(), which is called from
URLopener.open(),drops the protocol.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
Following is a printout of how to reproduce the bug in an interactive
python session (launch python at command line):

Python 1.5.2 (#1, Jul  5 2001, 03:02:19)  [GCC 2.96 20000731 (Red Hat
Linux 7.1 2 on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import urllib
>>> retriever = urllib.URLopener()
>>> webdoc = retriever.open('http://www.yahoo.com')
>>> print webdoc.url
://www.yahoo.com
>>> 

Note that "webdoc.url" should also include the protocol. Red Hat's
version of Python 1.5.2 doesn't. 
 

Actual Results:  The object returned from URLopener.open() is missing a
protocol in its 'url' class member.

Expected Results:  The object returned should have the protocol included
in the 'url' member.

Additional info:

This is specific to Red Hat's version of Pyton 1.5.2

I have a patch available which I will try to upload to bugzilla.

Comment 1 Joe Antao 2001-12-09 01:55:39 UTC
Created attachment 40187 [details]
patches /usr/lib/python1.5/urllib.py in Red Hat 7.1 and 7.2

Comment 2 Kjetil T. Homme 2002-01-31 22:57:47 UTC
A different patch is to initialise urltype to "http" on line 229.

Comment 3 Trond Eivind Glomsrxd 2002-08-14 16:22:18 UTC
This is fixed in python 2.2, e.g. 2.2.1-16


Note You need to log in before you can comment on or make changes to this bug.