More codestring -> codebytes.

This commit is contained in:
Georg Brandl 2009-06-04 09:42:55 +00:00
parent 3ed0deb9af
commit 706824f19f
10 changed files with 16 additions and 15 deletions

View file

@ -1758,7 +1758,8 @@ class URLopener:
msg.append('Content-type: %s' % type)
if encoding == 'base64':
import base64
data = base64.decodestring(data)
# XXX is this encoding/decoding ok?
data = base64.decodebytes(data.encode('ascii')).decode('latin1')
else:
data = unquote(data)
msg.append('Content-Length: %d' % len(data))