From 5ead5549d07b63ecfe4ff1136bf43fa26f9004cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sat, 8 Dec 2012 14:18:26 -0500 Subject: [PATCH 1/4] Add versionchanged note for a56cebff113a --- Doc/distutils/apiref.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst index 60c0dd8fe75..76567ad7354 100644 --- a/Doc/distutils/apiref.rst +++ b/Doc/distutils/apiref.rst @@ -991,6 +991,9 @@ directories. these files is available in answer D2 of the `NFS FAQ page `_. + .. versionchanged:: 2.7.4 + NFS files are ignored. + .. function:: remove_tree(directory[, verbose=0, dry_run=0]) From 26ea4a08a3f3b836581c30ccb933304b6c27ea66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sat, 8 Dec 2012 14:41:39 -0500 Subject: [PATCH 2/4] Remove code unneeded after f833e7ec4de1 --- Lib/distutils/config.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py index 9d8b30ea30c..1d327143bea 100644 --- a/Lib/distutils/config.py +++ b/Lib/distutils/config.py @@ -47,11 +47,6 @@ class PyPIRCCommand(Command): f.write(DEFAULT_PYPIRC % (username, password)) finally: f.close() - try: - os.chmod(rc, 0600) - except OSError: - # should do something better here - pass def _read_pypirc(self): """Reads the .pypirc file.""" From 2320fa08a81dd1fbf780521069dc19db66fce962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sat, 8 Dec 2012 22:26:57 -0500 Subject: [PATCH 3/4] Fix setup.py register failure with invalid rst in description (#13614). Original patch by Julien Courteau and Pierre Paul Lefebvre. --- Lib/distutils/command/check.py | 3 +++ Lib/distutils/tests/test_register.py | 25 +++++++++++++++++++++---- Misc/ACKS | 2 ++ Misc/NEWS | 3 +++ 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Lib/distutils/command/check.py b/Lib/distutils/command/check.py index 4b64e458bc2..152bf0de98b 100644 --- a/Lib/distutils/command/check.py +++ b/Lib/distutils/command/check.py @@ -26,6 +26,9 @@ try: def system_message(self, level, message, *children, **kwargs): self.messages.append((level, message, children, kwargs)) + return nodes.system_message(message, level=level, + type=self.levels[level], + *children, **kwargs) HAS_DOCUTILS = True except ImportError: diff --git a/Lib/distutils/tests/test_register.py b/Lib/distutils/tests/test_register.py index aa9bc43c5cf..9a0ff34c451 100644 --- a/Lib/distutils/tests/test_register.py +++ b/Lib/distutils/tests/test_register.py @@ -1,6 +1,5 @@ # -*- encoding: utf8 -*- """Tests for distutils.command.register.""" -import sys import os import unittest import getpass @@ -11,11 +10,14 @@ from test.test_support import check_warnings, run_unittest from distutils.command import register as register_module from distutils.command.register import register -from distutils.core import Distribution from distutils.errors import DistutilsSetupError -from distutils.tests import support -from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase +from distutils.tests.test_config import PyPIRCCommandTestCase + +try: + import docutils +except ImportError: + docutils = None PYPIRC_NOPASSWORD = """\ [distutils] @@ -264,6 +266,21 @@ class RegisterTestCase(PyPIRCCommandTestCase): finally: del register_module.raw_input + @unittest.skipUnless(docutils is not None, 'needs docutils') + def test_register_invalid_long_description(self): + description = ':funkie:`str`' # mimic Sphinx-specific markup + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx', + 'name': 'xxx', 'version': 'xxx', + 'long_description': description} + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = True + inputs = RawInputs('2', 'tarek', 'tarek@ziade.org') + register_module.raw_input = inputs + self.addCleanup(delattr, register_module, 'raw_input') + self.assertRaises(DistutilsSetupError, cmd.run) + def test_check_metadata_deprecated(self): # makes sure make_metadata is deprecated cmd = self._get_cmd() diff --git a/Misc/ACKS b/Misc/ACKS index 0a7c8bd2e21..87499b65768 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -201,6 +201,7 @@ David Costanzo Scott Cotton Greg Couch David Cournapeau +Julien Courteau Steve Cousins Alex Coventry Matthew Dixon Cowles @@ -572,6 +573,7 @@ Inyeol Lee Thomas Lee Christopher Lee Luc Lefebvre +Pierre Paul Lefebvre Glyph Lefkowitz Vincent Legoll Kip Lehman diff --git a/Misc/NEWS b/Misc/NEWS index 0c01e8b6ab8..3981f570bdb 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -158,6 +158,9 @@ Library - Issue #16628: Fix a memory leak in ctypes.resize(). +- Issue #13614: Fix setup.py register failure with invalid rst in description. + Patch by Julien Courteau and Pierre Paul Lefebvre. + - Issue #10182: The re module doesn't truncate indices to 32 bits anymore. Patch by Serhiy Storchaka. From 9e06e8d5dec7b2f4ca28f9a50c16467dfcebee7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sat, 8 Dec 2012 22:30:47 -0500 Subject: [PATCH 4/4] Use proper skip instead of reporting success in one distutils test --- Lib/distutils/tests/test_register.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Lib/distutils/tests/test_register.py b/Lib/distutils/tests/test_register.py index 9a0ff34c451..4f34b18bd8f 100644 --- a/Lib/distutils/tests/test_register.py +++ b/Lib/distutils/tests/test_register.py @@ -194,6 +194,7 @@ class RegisterTestCase(PyPIRCCommandTestCase): self.assertEqual(headers['Content-length'], '290') self.assertTrue('tarek' in req.data) + @unittest.skipUnless(docutils is not None, 'needs docutils') def test_strict(self): # testing the script option # when on, the register command stops if @@ -206,13 +207,6 @@ class RegisterTestCase(PyPIRCCommandTestCase): cmd.strict = 1 self.assertRaises(DistutilsSetupError, cmd.run) - # we don't test the reSt feature if docutils - # is not installed - try: - import docutils - except ImportError: - return - # metadata are OK but long_description is broken metadata = {'url': 'xxx', 'author': 'xxx', 'author_email': u'éxéxé',