summaryrefslogtreecommitdiffstats
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r--Lib/urllib/request.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 89ac22a..bb67267 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -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))