From: Antoine Pitrou Date: Sun, 22 Dec 2013 17:14:56 +0000 (+0100) Subject: Fix TypeError on "setup.py upload --show-response". X-Git-Tag: v3.4.0b2~131 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=20d5adea6a9dd5a752f2d8bb2b0cef0ee7cf386e;p=thirdparty%2FPython%2Fcpython.git Fix TypeError on "setup.py upload --show-response". --- 20d5adea6a9dd5a752f2d8bb2b0cef0ee7cf386e diff --cc Lib/distutils/tests/test_upload.py index 1fcba889b29c,8532369aa50a..f53eb266ed9d --- a/Lib/distutils/tests/test_upload.py +++ b/Lib/distutils/tests/test_upload.py @@@ -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 1f20423dbade,8dddb6afe647..7345ddb8ea93 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -44,6 -29,10 +44,8 @@@ Core and Builtin Library ------- + - Fix TypeError on "setup.py upload --show-response". + -- Issue #12226: HTTPS is now used by default when connecting to PyPI. - - Issue #20045: Fix "setup.py register --list-classifiers". - Issue #18879: When a method is looked up on a temporary file, avoid closing