Bug 563776 - urlgrabber's MirrorGroup doesn't handle urls as unicode strings
Summary: urlgrabber's MirrorGroup doesn't handle urls as unicode strings
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: python-urlgrabber
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: James Antill
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-11 04:12 UTC by Toshio Ernie Kuratomi
Modified: 2014-01-21 23:13 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-09-03 19:45:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch to allow url arguments to be of type unicode (3.46 KB, patch)
2010-02-11 04:12 UTC, Toshio Ernie Kuratomi
no flags Details | Diff

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.


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