Éric Araujo [Fri, 21 Oct 2011 05:34:00 +0000 (07:34 +0200)]
Document that packaging doesn’t create __init__.py files (#3902).
The bug reported expected distutils to create an __init__.py file for a
project using only C extension modules. IMO, how Python imports
packages and submodules is well documented, and it’s never suggested
that distutils might create an __init__.py file, so I’m adding this
clarification to the packaging docs but won’t backport unless other
people tell me they shared the same wrong expectation.
Éric Araujo [Fri, 21 Oct 2011 04:27:06 +0000 (06:27 +0200)]
Fix missing imports in setup scripts generated by packaging (#13205).
I’ve made more edits than the bug report suggested to make sure the
generated setup script is compatible with many Python versions; a
comment in the source explains that in detail.
The cfg_to_args function uses old 2.x idioms like codecs.open and
RawConfigParser.readfp because I want the setup.py generated by packaging and
distutils2 to be the same. Most users won’t see the deprecation warning and I
ignore it in the test suite.
Thanks to David Barnett for the report and original patch.
Antoine Pitrou [Thu, 20 Oct 2011 21:54:17 +0000 (23:54 +0200)]
Issue #12170: The count(), find(), rfind(), index() and rindex() methods
of bytes and bytearray objects now accept an integer between 0 and 255
as their first argument. Patch by Petri Lehtinen.
Senthil Kumaran [Wed, 19 Oct 2011 17:52:41 +0000 (01:52 +0800)]
default - Fix closes Issue6090 - Raise a ValueError, instead of failing with unrelated
exceptions, when a document with timestamp earlier than 1980 is provided to
zipfile. Patch contributed by Petri Lehtinen.
Senthil Kumaran [Wed, 19 Oct 2011 17:46:00 +0000 (01:46 +0800)]
3.2 - Fix closes Issue6090 - Raise a ValueError, instead of failing with unrelated
exceptions, when a document with timestamp earlier than 1980 is provided to
zipfile. Patch contributed by Petri Lehtinen.
Éric Araujo [Wed, 19 Oct 2011 06:49:20 +0000 (08:49 +0200)]
Clean up some idioms in packaging tests.
- Use os.makedirs (I had forgotten about it!)
- Let TempdirManager.write_file call os.path.join for us
- Remove custom command added by test_dist
- Use a skip instead of hiding a method with an underscore
- Address pyflakes warnings
Éric Araujo [Wed, 19 Oct 2011 06:37:22 +0000 (08:37 +0200)]
Change signature of packaging.tests.support.LoggingCatcher.get_logs.
I need this for some tests, and it makes code clearer. This commit also
changes some assertEqual calls to use (actual, expected) order and fix
some pyflakes warnings.
Łukasz Langa [Wed, 19 Oct 2011 00:40:48 +0000 (02:40 +0200)]
A ricochet from fixing #10680: http://http://example.com/ no longer reports
'nonnumeric port'. It parses to a host name of "http:" which is equivalent to
http:80.
Victor Stinner [Tue, 18 Oct 2011 19:21:00 +0000 (21:21 +0200)]
Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignore
error handlers on all Windows versions. The MBCS codec is now supporting all
error handlers, instead of only replace to encode and ignore to decode.
Antoine Pitrou [Tue, 18 Oct 2011 15:52:24 +0000 (17:52 +0200)]
Issue #13150: sysconfig no longer parses the Makefile and config.h files
when imported, instead doing it at build time. This makes importing
sysconfig faster and reduces Python startup time by 20%.
Antoine Pitrou [Tue, 18 Oct 2011 14:42:55 +0000 (16:42 +0200)]
Issue #13188: When called without an explicit traceback argument,
generator.throw() now gets the traceback from the passed exception's
``__traceback__`` attribute. Patch by Petri Lehtinen.
Antoine Pitrou [Tue, 18 Oct 2011 14:40:50 +0000 (16:40 +0200)]
Issue #13188: When called without an explicit traceback argument,
generator.throw() now gets the traceback from the passed exception's
`__traceback__` attribute. Patch by Petri Lehtinen.
Victor Stinner [Mon, 17 Oct 2011 18:18:58 +0000 (20:18 +0200)]
Instantiate the OS-related exception as soon as we raise it, so that "except"
works properly.
PyErr_SetFromErrnoWithFilenameObject() was already fixed by the changeset 793c75177d28. This commit fixes PyErr_SetExcFromWindowsErrWithFilenameObject(),
used on Windows.