]> granicus.if.org Git - python/commitdiff
#10510: Fix bug in forward port of 2.7 distutils patch.
authorR David Murray <rdmurray@bitdance.com>
Sun, 28 Sep 2014 15:01:42 +0000 (11:01 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sun, 28 Sep 2014 15:01:42 +0000 (11:01 -0400)
Pointed out by Arfrever.

1  2 
Lib/distutils/command/upload.py

index e3f6f69607d319a55d7dc72929dec7cc5f97754e,1a96e2221e17455a53b40afefae6e1fc9f16a9da..1c4fc48a12935993f747e08cfef583a14085fcb7
@@@ -162,18 -164,15 +162,17 @@@ class upload(PyPIRCCommand)
                  if value and value[-1:] == b'\r':
                      body.write(b'\n')  # write an extra newline (lurve Macs)
          body.write(end_boundary)
-         body.write(b"\r\n")
          body = body.getvalue()
  
 -        self.announce("Submitting %s to %s" % (filename, self.repository), log.INFO)
 +        msg = "Submitting %s to %s" % (filename, self.repository)
 +        self.announce(msg, log.INFO)
  
          # build the Request
 -        headers = {'Content-type':
 -                        'multipart/form-data; boundary=%s' % boundary,
 -                   'Content-length': str(len(body)),
 -                   'Authorization': auth}
 +        headers = {
 +            'Content-type': 'multipart/form-data; boundary=%s' % boundary,
 +            'Content-length': str(len(body)),
 +            'Authorization': auth,
 +        }
  
          request = Request(self.repository, data=body,
                            headers=headers)