diff Lib/distutils/command/upload.py @ 57845:ea5e54bd6274

Merged revisions 76952 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76952 | tarek.ziade | 2009-12-21 00:23:34 +0100 (Mon, 21 Dec 2009) | 1 line Fixed #7552: fixed distutils.command.upload failure on very long passwords ........
author Tarek Ziadé <ziade.tarek@gmail.com>
date Mon, 21 Dec 2009 00:02:20 +0000
parents f47ce11e072b
children 39ab1a36b209
line wrap: on
line diff
--- a/Lib/distutils/command/upload.py	Sun Dec 20 20:37:56 2009 +0000
+++ b/Lib/distutils/command/upload.py	Mon Dec 21 00:02:20 2009 +0000
@@ -6,7 +6,7 @@
 import socket
 import platform
 from urllib.request import urlopen, Request, HTTPError
-import base64
+from base64 import standard_b64encode
 from urllib.parse import urlparse
 from hashlib import md5
 
@@ -130,7 +130,7 @@
         user_pass = (self.username + ":" + self.password).encode('ascii')
         # The exact encoding of the authentication string is debated.
         # Anyway PyPI only accepts ascii for both username or password.
-        auth = "Basic " + base64.encodebytes(user_pass).strip().decode('ascii')
+        auth = "Basic " + standard_b64encode(user_pass).decode('ascii')
 
         # Build up the MIME payload for the POST data
         boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'