Bug 57293

Summary: python 1.5.2 urllib open_http() drops protocol
Product: [Retired] Red Hat Linux Reporter: Joe Antao <joefefifo>
Component: pythonAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://home.earthlink.net/~joefefifo/plucker/fix_detailed.html
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-08-14 16:26:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patches /usr/lib/python1.5/urllib.py in Red Hat 7.1 and 7.2 none

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