[ python-Bugs-1473560 ] urllib2.Request constructor to urllib.quote the url given

SourceForge.net noreply at sourceforge.net
Sun Apr 30 11:25:44 CEST 2006


Bugs item #1473560, was opened at 2006-04-20 14:02
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473560&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Nikos Kouremenos (nkour)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2.Request constructor to urllib.quote the url given

Initial Comment:
urllib2.Request('http://www.google.com/search?client=firefox&q=foo
bar', None)


this fails. it shouldn't

----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-04-30 09:25

Message:
Logged In: YES 
user_id=849994

The docs say that the argument to the Request constructor
must be a valid URL. A valid URL doesn't contain spaces, so
the behavior is consistent.

----------------------------------------------------------------------

Comment By: Nikos Kouremenos (nkour)
Date: 2006-04-29 11:34

Message:
Logged In: YES 
user_id=865368

it's foo bar not foobar. and space should be automatcally
become %20 (urllib.quote()) but it doesn't. please reopen

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2006-04-28 19:19

Message:
Logged In: YES 
user_id=849994

I don't know what your problem is. This works perfectly for me:

>>> r =
urllib2.Request("http://www.google.com/search?client=firefox&q=foobar",
None)
>>> o = urllib2.HTTPHandler()
>>> u = o.http_open(r)
>>> u.read()
"..."

Closing as "Works for me". If you have another problem,
please reopen

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1473560&group_id=5470


More information about the Python-bugs-list mailing list