]> granicus.if.org Git - python/commitdiff
Fix TypeError on "setup.py upload --show-response".
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 22 Dec 2013 17:14:56 +0000 (18:14 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 22 Dec 2013 17:14:56 +0000 (18:14 +0100)
1  2 
Lib/distutils/command/upload.py
Lib/distutils/config.py
Lib/distutils/tests/test_upload.py
Misc/NEWS

Simple merge
Simple merge
index 1fcba889b29c49f388b25ee8f6a7edc93c162277,8532369aa50a4eee4007373c35fac0578815968b..f53eb266ed9daee8b311bd750e65a60ce7808b4b
@@@ -111,16 -121,20 +121,21 @@@ class uploadTestCase(PyPIRCCommandTestC
          cmd.ensure_finalized()
          cmd.run()
  
-          # what did we send ?
+         # what did we send ?
          headers = dict(self.last_open.req.headers)
          self.assertEqual(headers['Content-length'], '2087')
 -        self.assertTrue(headers['Content-type'].startswith('multipart/form-data'))
 +        content_type = headers['Content-type']
 +        self.assertTrue(content_type.startswith('multipart/form-data'))
          self.assertEqual(self.last_open.req.get_method(), 'POST')
 -        self.assertEqual(self.last_open.req.get_full_url(),
 -                         'https://pypi.python.org/pypi')
 -        self.assertIn(b'xxx', self.last_open.req.data)
 +        expected_url = 'https://pypi.python.org/pypi'
 +        self.assertEqual(self.last_open.req.get_full_url(), expected_url)
 +        self.assertTrue(b'xxx' in self.last_open.req.data)
  
+         # The PyPI response body was echoed
+         results = self.get_logs(INFO)
+         self.assertIn('xyzzy\n', results[-1])
  def test_suite():
      return unittest.makeSuite(uploadTestCase)
  
diff --cc Misc/NEWS
index 1f20423dbadeba83ed5342c059c6c93ac6d9de34,8dddb6afe647b84d12ef490b493c20d158744489..7345ddb8ea93b84e91f036d31195a6f91c223aa7
+++ b/Misc/NEWS
@@@ -44,6 -29,10 +44,8 @@@ Core and Builtin
  Library
  -------
  
 -- Issue #12226: HTTPS is now used by default when connecting to PyPI.
 -
+ - Fix TypeError on "setup.py upload --show-response".
  - Issue #20045: Fix "setup.py register --list-classifiers".
  
  - Issue #18879: When a method is looked up on a temporary file, avoid closing