From 021eddfff6c50ac64a430fc90fc23ace8ae07596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Sat, 25 Feb 2012 16:13:53 +0100 Subject: [PATCH 1/3] Fix long-standing bugs with MANIFEST.in parsing on Windows (#6884). These regex changes fix a number of issues for distutils on Windows: - #6884: impossible to include a file starting with 'build' - #9691 and #14004: sdist includes too many files - #13193: test_filelist failures This commit replaces the incorrect changes done in 557a973709de, c566a3447ba1 and 3925081a7ca0 to fix #13193; we were too eager to fix the test failures and I did not study the code enough before greenlighting patches. This time we have unit tests from the problems reported by users to be sure we have the right fix. Thanks to Nadeem Vawda for his help. --- Lib/distutils/filelist.py | 20 +++-- Lib/distutils/tests/test_filelist.py | 111 +++++++++++++++++---------- Lib/distutils/tests/test_sdist.py | 14 +++- Misc/NEWS | 5 +- 4 files changed, 97 insertions(+), 53 deletions(-) diff --git a/Lib/distutils/filelist.py b/Lib/distutils/filelist.py index 5540b39a380..2f1c457ea0b 100644 --- a/Lib/distutils/filelist.py +++ b/Lib/distutils/filelist.py @@ -210,6 +210,7 @@ class FileList: Return 1 if files are found. """ + # XXX docstring lying about what the special chars are? files_found = 0 pattern_re = translate_pattern(pattern, anchor, prefix, is_regex) self.debug_print("include_pattern: applying regex r'%s'" % @@ -297,11 +298,14 @@ def glob_to_re(pattern): # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix, # and by extension they shouldn't match such "special characters" under # any OS. So change all non-escaped dots in the RE to match any - # character except the special characters. - # XXX currently the "special characters" are just slash -- i.e. this is - # Unix-only. - pattern_re = re.sub(r'((? Date: Thu, 22 Mar 2012 23:32:23 -0400 Subject: [PATCH 2/3] move news thing around --- Misc/NEWS | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index bd91bb27578..d7f63ae6a11 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1,6 +1,17 @@ Python News +++++++++++ +What's New in Python 2.7.3 final? +================================= + +*Release date: 2012-XX-XX* + +Library +------- + +- Issue #6884: Fix long-standing bugs with MANIFEST.in parsing in distutils + on Windows. + What's New in Python 2.7.3 release candidate 2? =============================================== @@ -113,9 +124,6 @@ Core and Builtins Library ------- -- Issue #6884: Fix long-standing bugs with MANIFEST.in parsing in distutils - on Windows. - - Issue #8033: sqlite3: Fix 64-bit integer handling in user functions on 32-bit architectures. Initial patch by Philippe Devalkeneer. From f51c384a0af9cc233b52ea98313e312dcb414dce Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 9 Apr 2012 14:53:07 -0400 Subject: [PATCH 3/3] fix build without Py_DEBUG and DNDEBUG (closes #14509) --- Objects/stringobject.c | 2 ++ Objects/unicodeobject.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 982679258b6..ab377dd7a2d 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -1262,7 +1262,9 @@ string_hash(PyStringObject *a) register unsigned char *p; register long x; +#ifdef Py_DEBUG assert(_Py_HashSecret_Initialized); +#endif if (a->ob_shash != -1) return a->ob_shash; len = Py_SIZE(a); diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 4fb1aeda356..710bcf393c6 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -6538,7 +6538,9 @@ unicode_hash(PyUnicodeObject *self) register Py_UNICODE *p; register long x; +#ifdef Py_DEBUG assert(_Py_HashSecret_Initialized); +#endif if (self->hash != -1) return self->hash; len = PyUnicode_GET_SIZE(self);