Message182216
| Author |
Mi.Zou |
| Recipients |
Mi.Zou, ezio.melotti |
| Date |
2013年02月16日.10:52:39 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1361011959.8.0.221376430084.issue17214@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
while urllib following the redirection(302):
urllib.client.HTTPConnection.putrequest raise an error:
#----------------------------------------------------------
File "D:\Program Files\Python32\lib\http\client.py", line 1004, in _send_request
self.putrequest(method, url, **skips)
File "D:\Program Files\Python32\lib\http\client.py", line 868, in putrequest
self._output(request.encode('ascii'))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 108-111: ordinal not in range(128)
#----------------------------------------------------------
in the sourcode i found that:
at line 811
def putrequest(self, method, url, skip_host=0,skip_accept_encoding=0)...
the argument url may be a unicode,and it was unquoted..
i think we should replace:
request = '%s %s %s' (method,url,self._http_vsn_str)
with:
import urllib.parse
request = '%s %s %s' (method,urllib.parse.quote(url),self._http_vsn_str) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年02月16日 10:52:39 | Mi.Zou | set | recipients:
+ Mi.Zou, ezio.melotti |
| 2013年02月16日 10:52:39 | Mi.Zou | set | messageid: <1361011959.8.0.221376430084.issue17214@psf.upfronthosting.co.za> |
| 2013年02月16日 10:52:39 | Mi.Zou | link | issue17214 messages |
| 2013年02月16日 10:52:39 | Mi.Zou | create |
|