From 04ea9533c11edd30b2c482cacb3acf5678f33dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sat, 8 Oct 2011 03:02:37 +0200 Subject: Fix docstring of distutils.util.byte_compile (followup for #11254) --- Lib/distutils/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 631f5df..f42c6a1 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -419,9 +419,9 @@ def byte_compile (py_files, verbose=1, dry_run=0, direct=None): """Byte-compile a collection of Python source files to either .pyc - or .pyo files in the same directory. 'py_files' is a list of files - to compile; any files that don't end in ".py" are silently skipped. - 'optimize' must be one of the following: + or .pyo files in a __pycache__ subdirectory. 'py_files' is a list + of files to compile; any files that don't end in ".py" are silently + skipped. 'optimize' must be one of the following: 0 - don't optimize (generate .pyc) 1 - normal optimization (like "python -O") 2 - extra optimization (like "python -OO") -- cgit v0.12 From 8af607b4c828297b74e28ae58e01aebe4412f916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sun, 9 Oct 2011 06:32:38 +0200 Subject: As it turns out, this bug was already in the tracker: #11171 --- Misc/NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index dfbeb4d..1ecb125 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -43,8 +43,8 @@ Core and Builtins Library ------- -- Fix distutils.sysconfig.get_makefile_filename when Python was configured with - different prefix and exec-prefix. +- Issue #11171: Fix distutils.sysconfig.get_makefile_filename when Python was + configured with different prefix and exec-prefix. - Issue #11254: Teach distutils to compile .pyc and .pyo files in PEP 3147-compliant __pycache__ directories. -- cgit v0.12 From 5819dcc0d262ef0ceaffc68d1b65f3d031e27b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sun, 9 Oct 2011 07:25:33 +0200 Subject: =?UTF-8?q?Add=20tests=20for=20Unicode=20handling=20in=20distutils?= =?UTF-8?q?=E2=80=99=20check=20and=20register=20(#13114)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lib/distutils/tests/test_check.py | 13 +++++++++++-- Lib/distutils/tests/test_register.py | 20 +++++++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Lib/distutils/tests/test_check.py b/Lib/distutils/tests/test_check.py index 229ae25..4de6473 100644 --- a/Lib/distutils/tests/test_check.py +++ b/Lib/distutils/tests/test_check.py @@ -46,6 +46,15 @@ class CheckTestCase(support.LoggingSilencer, cmd = self._run(metadata, strict=1) self.assertEqual(cmd._warnings, 0) + # now a test with non-ASCII characters + metadata = {'url': 'xxx', 'author': '\u00c9ric', + 'author_email': 'xxx', 'name': 'xxx', + 'version': 'xxx', + 'description': 'Something about esszet \u00df', + 'long_description': 'More things about esszet \u00df'} + cmd = self._run(metadata) + self.assertEqual(cmd._warnings, 0) + def test_check_document(self): if not HAS_DOCUTILS: # won't test without docutils return @@ -80,8 +89,8 @@ class CheckTestCase(support.LoggingSilencer, self.assertRaises(DistutilsSetupError, self._run, metadata, **{'strict': 1, 'restructuredtext': 1}) - # and non-broken rest - metadata['long_description'] = 'title\n=====\n\ntest' + # and non-broken rest, including a non-ASCII character to test #12114 + metadata['long_description'] = 'title\n=====\n\ntest \u00df' cmd = self._run(metadata, strict=1, restructuredtext=1) self.assertEqual(cmd._warnings, 0) diff --git a/Lib/distutils/tests/test_register.py b/Lib/distutils/tests/test_register.py index cb72a11..5863ae1 100644 --- a/Lib/distutils/tests/test_register.py +++ b/Lib/distutils/tests/test_register.py @@ -214,7 +214,7 @@ class RegisterTestCase(PyPIRCCommandTestCase): # metadata are OK but long_description is broken metadata = {'url': 'xxx', 'author': 'xxx', - 'author_email': 'xxx', + 'author_email': 'éxéxé', 'name': 'xxx', 'version': 'xxx', 'long_description': 'title\n==\n\ntext'} @@ -247,6 +247,24 @@ class RegisterTestCase(PyPIRCCommandTestCase): finally: del register_module.input + # and finally a Unicode test (bug #12114) + metadata = {'url': 'xxx', 'author': '\u00c9ric', + 'author_email': 'xxx', 'name': 'xxx', + 'version': 'xxx', + 'description': 'Something about esszet \u00df', + 'long_description': 'More things about esszet \u00df'} + + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = 1 + inputs = Inputs('1', 'tarek', 'y') + register_module.input = inputs.__call__ + # let's run the command + try: + cmd.run() + finally: + del register_module.input + def test_check_metadata_deprecated(self): # makes sure make_metadata is deprecated cmd = self._get_cmd() -- cgit v0.12