Bug 563776

Summary: urlgrabber's MirrorGroup doesn't handle urls as unicode strings
Product: [Fedora] Fedora Reporter: Toshio Ernie Kuratomi <a.badger>
Component: python-urlgrabberAssignee: James Antill <james.antill>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: james.antill
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-09-03 19:45:36 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
Patch to allow url arguments to be of type unicode none

Description Toshio Ernie Kuratomi 2010-02-11 04:12:09 UTC
Created attachment 390161 [details]
Patch to allow url arguments to be of type unicode

Description of problem:

I am working on some code that handed a url as a unicode string to urlgrabber.  This lead to a problem with two sections of code.  One is in mirror.py where we're only allowing byte strings.  The other is in grabber.py which hands off the unicode strings to pycurl.  pycurl only understands byte strings and raises an error if a unicode string is given to it.

We need to transform any unicode strings into byte strings before it gets to curl.  Since we're doing that, we might as well allow unicode strings in mirror.py and transform those to byte strings as well.

Version-Release number of selected component (if applicable):
3.9.1-4 and current git HEAD.

How reproducible:
Everytime

Steps to Reproduce:
1. import urlgrabber
2. urlgrabber.urlread(u'http://fedoraproject.org')
3.
  
Actual results:
Traceback from pycurl

Expected results:
Return the page from the URL.

Additional info:
Will attach a patch that fixes this (and also a typo in the exception name that I saw at the same time.)

Comment 1 Bug Zapper 2010-03-15 14:29:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 seth vidal 2010-09-03 19:45:36 UTC
patch applied, will be out in 3.9.2 - thank you.