Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67df285

Browse files
committed
Merge 3.2
2 parents 9255464 + a5bc34f commit 67df285

4 files changed

Lines changed: 35 additions & 8 deletions

File tree

Lib/distutils/tests/test_check.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ def test_check_metadata(self):
4646
cmd = self._run(metadata, strict=1)
4747
self.assertEqual(cmd._warnings, 0)
4848

49+
# now a test with non-ASCII characters
50+
metadata = {'url': 'xxx', 'author': '\u00c9ric',
51+
'author_email': 'xxx', 'name': 'xxx',
52+
'version': 'xxx',
53+
'description': 'Something about esszet \u00df',
54+
'long_description': 'More things about esszet \u00df'}
55+
cmd = self._run(metadata)
56+
self.assertEqual(cmd._warnings, 0)
57+
4958
def test_check_document(self):
5059
if not HAS_DOCUTILS: # won't test without docutils
5160
return
@@ -80,8 +89,8 @@ def test_check_restructuredtext(self):
8089
self.assertRaises(DistutilsSetupError, self._run, metadata,
8190
**{'strict': 1, 'restructuredtext': 1})
8291

83-
# and non-broken rest
84-
metadata['long_description'] = 'title\n=====\n\ntest'
92+
# and non-broken rest, including a non-ASCII character to test #12114
93+
metadata['long_description'] = 'title\n=====\n\ntest \u00df'
8594
cmd = self._run(metadata, strict=1, restructuredtext=1)
8695
self.assertEqual(cmd._warnings, 0)
8796

Lib/distutils/tests/test_register.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def test_strict(self):
214214

215215
# metadata are OK but long_description is broken
216216
metadata = {'url': 'xxx', 'author': 'xxx',
217-
'author_email': 'xxx',
217+
'author_email': 'éxéxé',
218218
'name': 'xxx', 'version': 'xxx',
219219
'long_description': 'title\n==\n\ntext'}
220220

@@ -247,6 +247,24 @@ def test_strict(self):
247247
finally:
248248
del register_module.input
249249

250+
# and finally a Unicode test (bug #12114)
251+
metadata = {'url': 'xxx', 'author': '\u00c9ric',
252+
'author_email': 'xxx', 'name': 'xxx',
253+
'version': 'xxx',
254+
'description': 'Something about esszet \u00df',
255+
'long_description': 'More things about esszet \u00df'}
256+
257+
cmd = self._get_cmd(metadata)
258+
cmd.ensure_finalized()
259+
cmd.strict = 1
260+
inputs = Inputs('1', 'tarek', 'y')
261+
register_module.input = inputs.__call__
262+
# let's run the command
263+
try:
264+
cmd.run()
265+
finally:
266+
del register_module.input
267+
250268
def test_check_metadata_deprecated(self):
251269
# makes sure make_metadata is deprecated
252270
cmd = self._get_cmd()

Lib/distutils/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ def byte_compile (py_files,
419419
verbose=1, dry_run=0,
420420
direct=None):
421421
"""Byte-compile a collection of Python source files to either .pyc
422-
or .pyo files in the same directory. 'py_files' is a list of files
423-
to compile; any files that don't end in ".py" are silently skipped.
424-
'optimize' must be one of the following:
422+
or .pyo files in a __pycache__ subdirectory. 'py_files' is a list
423+
of files to compile; any files that don't end in ".py" are silently
424+
skipped. 'optimize' must be one of the following:
425425
0 - don't optimize (generate .pyc)
426426
1 - normal optimization (like "python -O")
427427
2 - extra optimization (like "python -OO")

Misc/NEWS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ Core and Builtins
301301
Library
302302
-------
303303

304-
- Fix distutils.sysconfig.get_makefile_filename when Python was configured with
305-
different prefix and exec-prefix.
304+
- Issue #11171: Fix distutils.sysconfig.get_makefile_filename when Python was
305+
configured with different prefix and exec-prefix.
306306

307307
- Issue #11254: Teach distutils and packaging to compile .pyc and .pyo files in
308308
PEP 3147-compliant __pycache__ directories.

0 commit comments

Comments
 (0)