Éric Araujo [Thu, 6 Oct 2011 03:10:09 +0000 (05:10 +0200)]
Fix incorrect test.
The packaging.install.remove function (a.k.a. the uninstall feature)
takes a path argument to allow client code to use custom directories
instead of sys.path. The test used to give self.root_dir as path, which
corresponds to a prefix option, but prefix is not on sys.path, it’s only
the base directory used to compute the stdlib and site-packages
directory paths. The test now gives a valid site-packages path to the
function.
Éric Araujo [Thu, 6 Oct 2011 02:59:41 +0000 (04:59 +0200)]
Change one name in packaging’s test_uninstall to avoid confusion.
install_lib may be the name of a module, a command or an option, so I
find it clearer to use site_packages to refer to a string object
containing the path of the site-packages directory created in a
temporary directory during tests.
Victor Stinner [Wed, 5 Oct 2011 23:45:57 +0000 (01:45 +0200)]
Don't check for the maximum character when copying from unicodeobject.c
* Create copy_characters() function which doesn't check for the maximum
character in release mode
* _PyUnicode_CheckConsistency() is no more static to be able to use it
in _PyUnicode_FormatAdvanced() (in formatter_unicode.c)
* _PyUnicode_CheckConsistency() checks the string hash
Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
would be finalized after the reference to its underlying BufferedRWPair's
writer got cleared by the GC.
Éric Araujo [Tue, 4 Oct 2011 23:50:22 +0000 (01:50 +0200)]
Update skip message printed by test.support.get_attribute.
This helper was changed to work with any object instead of only modules
(or technically something with a __name__ attribute, see code in 3.2)
but the message stayed as is.
Éric Araujo [Tue, 4 Oct 2011 23:46:37 +0000 (01:46 +0200)]
Cosmetic fixes for whitespace and a regex in packaging.
The goal of the regex is to catch a (alpha), b (beta), c or rc
(release candidate), so the existing pattern puzzled me. Tests were
OK before and after the change.
Éric Araujo [Tue, 4 Oct 2011 23:28:24 +0000 (01:28 +0200)]
Fix markup used in the documentation of sys.prefix and sys.exec_prefix.
- Using the file role with {placeholders} is IMO clearer than fake
Python code.
- The fact that sys.version[:3] gives '3.2' is a CPython detail and
should not be advertised (see #9442), even if some stdlib modules
currently rely on that detail.
Éric Araujo [Tue, 4 Oct 2011 23:06:31 +0000 (01:06 +0200)]
Fix minor wording issue.
sys.maxunicode is not called and thus does not return anything; it *is*
something. (I checked the doc quickly to see if it tells that
expression return things but found nothing.)
I also removed markup that would just generate a useless link to the
enclosing section.
Antoine Pitrou [Tue, 4 Oct 2011 10:28:52 +0000 (12:28 +0200)]
Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
if the underlying raw stream is unseekable, even if the seek could be
satisfied using the internal buffer. Patch by John OConnor.
Antoine Pitrou [Tue, 4 Oct 2011 10:26:20 +0000 (12:26 +0200)]
Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
if the underlying raw stream is unseekable, even if the seek could be
satisfied using the internal buffer. Patch by John O'Connor.
Antoine Pitrou [Tue, 4 Oct 2011 07:25:28 +0000 (09:25 +0200)]
Issue #7689: Allow pickling of dynamically created classes when their
metaclass is registered with copyreg. Patch by Nicolas M. Thiéry and
Craig Citro.
Antoine Pitrou [Tue, 4 Oct 2011 07:23:04 +0000 (09:23 +0200)]
Issue #7689: Allow pickling of dynamically created classes when their
metaclass is registered with copyreg. Patch by Nicolas M. Thiéry and
Craig Citro.
Victor Stinner [Mon, 3 Oct 2011 21:36:02 +0000 (23:36 +0200)]
PyUnicode_Join() checks output length in debug mode
PyUnicode_CopyCharacters() may copies less character than requested size, if
the input string is smaller than the argument. (This is very unlikely, but who
knows!?)
Avoid also calling PyUnicode_CopyCharacters() if the string is empty.
Victor Stinner [Wed, 5 Oct 2011 19:24:08 +0000 (21:24 +0200)]
Add asciilib: similar to ucs1, ucs2 and ucs4 library, but specialized to ASCII
ucs1, ucs2 and ucs4 libraries have to scan created substring to find the
maximum character, whereas it is not need to ASCII strings. Because ASCII
strings are common, it is useful to optimize ASCII.
Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
would be finalized after the reference to its underlying BufferedRWPair's
writer got cleared by the GC.
Victor Stinner [Wed, 5 Oct 2011 12:01:42 +0000 (14:01 +0200)]
Speedup str[a:b] and PyUnicode_FromKindAndData
* str[a:b] doesn't scan the string for the maximum character if the string
is ascii only
* PyUnicode_FromKindAndData() stops if we are sure that we cannot use a
shorter character type. For example, _PyUnicode_FromUCS1() stops if we
have at least one character in range U+0080-U+00FF