[Python-checkins] cpython (merge 3.2 -> default): Merge 3.2

eric.araujo python-checkins at python.org
Sun Oct 9 08:59:56 CEST 2011


http://hg.python.org/cpython/rev/a52b5be3676a
changeset:   72829:a52b5be3676a
parent:      72825:598213b176ef
parent:      72828:edc04ee314a9
user:        Éric Araujo <merwok at netwok.org>
date:        Sun Oct 09 08:58:16 2011 +0200
summary:
  Merge 3.2

files:
  Lib/distutils/tests/test_check.py    |  13 ++++++++-
  Lib/distutils/tests/test_register.py |  20 +++++++++++++++-
  Lib/distutils/util.py                |   6 ++--
  Misc/NEWS                            |   4 +-
  4 files changed, 35 insertions(+), 8 deletions(-)


diff --git a/Lib/distutils/tests/test_check.py b/Lib/distutils/tests/test_check.py
--- a/Lib/distutils/tests/test_check.py
+++ b/Lib/distutils/tests/test_check.py
@@ -46,6 +46,15 @@
         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 @@
         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
--- a/Lib/distutils/tests/test_register.py
+++ b/Lib/distutils/tests/test_register.py
@@ -214,7 +214,7 @@
 
         # 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 @@
         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()
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -419,9 +419,9 @@
                   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")
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -301,8 +301,8 @@
 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 and packaging to compile .pyc and .pyo files in
   PEP 3147-compliant __pycache__ directories.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list