Commit Graph

20208 Commits

Author SHA1 Message Date
Brett Cannon 1f14bebe3c Have importlib.test use argparse instead of some hacked up solution. 2012-02-17 09:37:39 -05:00
Brett Cannon ba17fe256e Have importlib use os.replace() for atomic renaming.
Closes issue #13961. Thanks to Charles-François Natali for the patch.
2012-02-17 09:26:53 -05:00
Brett Cannon f58d45c649 Tweak the handling of the empty string in sys.path for importlib.
It seems better to cache the finder for the cwd under its full path
insetad of '' in case the cwd changes. Otherwise FileFinder needs to
dynamically change itself based on whether it is given '' instead of
caching a finder for every change to the cwd.
2012-02-16 18:12:00 -05:00
Brett Cannon 22e7c88057 Merge 2012-02-16 18:03:47 -05:00
Brett Cannon 3b1a06c1ea importlib.__import__() now raises ValueError when level < 0.
This is to bring it more in line with what PEP 328 set out to do with
removing ambiguous absolute/relative import semantics.
2012-02-16 17:47:48 -05:00
Florent Xicluna 1639505c38 fix the _namespace_map cleanup for cElementTree tests. 2012-02-16 23:28:35 +01:00
Florent Xicluna e59a306081 The C accelerator was not always imported for cElementTree's tests. (there's still an issue with --huntrleaks switch) 2012-02-16 23:17:31 +01:00
Charles-François Natali 8e3926a810 Merge. 2012-02-16 19:54:48 +01:00
Charles-François Natali 4a72ebe34b Issue #13878: Fix random test_sched failures. 2012-02-16 19:51:45 +01:00
Charles-François Natali f670ca5e70 Issue #13878: Fix random test_sched failures. 2012-02-16 19:49:48 +01:00
Brett Cannon 7fab676e87 Refactor importlib.__import__() and _gcd_import() to facilitate using
an __import__ implementation that takes care of basics in C and punts
to importlib for more complicated code.
2012-02-16 13:43:41 -05:00
Éric Araujo e8c5fdba30 Add test for packaging.util.set_platform (#13974).
Patch by Tshepang Lekhonkhobe.
2012-02-16 19:32:17 +01:00
Eli Bendersky 292f9a891d make TestAccelerator[Not]Imported for ElementTree more robust 2012-02-16 19:55:29 +02:00
Eli Bendersky 66e6f8e525 Disabling a test that fails on some bots. Will investigate the failure soon 2012-02-16 18:08:44 +02:00
Gregory P. Smith 5b791fb548 Issue #2489: Fix bug in _copy loop that could consume 100% cpu on EOF. 2012-02-16 00:35:43 -08:00
Gregory P. Smith a124a688a2 don't use assertSameElements. 2012-02-16 00:34:12 -08:00
Gregory P. Smith 05f5953ab4 Issue #2489: Fix bug in _copy loop that could consume 100% cpu on EOF. 2012-02-16 00:29:12 -08:00
Eli Bendersky da57819efa in the tests of ElementTree, verify that the C accelerator is imported or not imported as expected 2012-02-16 06:52:39 +02:00
Victor Stinner 4aec77617f (Merge 3.2) Issue #13913: Another fix test_pep3120 for the UTF-8 codec name 2012-02-15 23:45:34 +01:00
Victor Stinner 5c724a804a Issue #13913: Another fix test_pep3120 for the UTF-8 codec name 2012-02-15 23:44:03 +01:00
Sandro Tosi cd77815e4c Issue #11836: document and expose multiprocessing.SimpleQueue 2012-02-15 23:27:00 +01:00
Victor Stinner 10e467c963 (Merge 3.2) Issue #13913: Fix test_pep3120 for the UTF-8 codec name 2012-02-15 22:25:51 +01:00
Victor Stinner 1303298d06 Issue #13913: Fix test_pep3120 for the UTF-8 codec name 2012-02-15 22:24:17 +01:00
Antoine Pitrou 482ee66cb7 Issue #7644: Add tests for the file argument of NNTP.head() and NNTP.body().
Patch by Hynek Schlawack.
2012-02-15 18:53:49 +01:00
Antoine Pitrou 2640b52237 Issue #7644: Add tests for the file argument of NNTP.head() and NNTP.body().
Patch by Hynek Schlawack.
2012-02-15 18:53:18 +01:00
Éric Araujo 43df889d63 Fix for packaging test failure on shared builds (#1326113) 2012-02-15 18:14:50 +01:00
Éric Araujo a76eff7db0 Merge fix from 3.2 2012-02-15 18:13:00 +01:00
Éric Araujo 2a57a36368 Fix test failure for shared builds caused by #1326113 fix 2012-02-15 18:12:12 +01:00
Éric Araujo 4575afcb53 Fix parsing of packaging’s build_ext --libraries option (#1326113) 2012-02-15 17:25:25 +01:00
Éric Araujo 1d175f7768 Merge fixes for #1326113 and #12297 from 3.2 2012-02-15 17:13:26 +01:00
Éric Araujo b2f5c0a4c4 Fix parsing of build_ext --libraries option (#1326113) 2012-02-15 16:44:37 +01:00
Brett Cannon 0568d6fd4e Bring importlib in line w/ changes made in my personal bootstrap branch in the sandbox. 2012-02-14 18:38:11 -05:00
Antoine Pitrou 06b57ef958 Issue #10287: nntplib now queries the server's CAPABILITIES first before sending MODE READER, and only sends it if not already in READER mode.
Patch by Hynek Schlawack.
2012-02-14 23:30:35 +01:00
Antoine Pitrou 71135624d8 Issue #10287: nntplib now queries the server's CAPABILITIES first before sending MODE READER, and only sends it if not already in READER mode.
Patch by Hynek Schlawack.
2012-02-14 23:29:34 +01:00
Meador Inge ffeee3518a Issue #13979: Fix ctypes.util.find_library ldconfig regex 2012-02-13 22:08:39 -06:00
Gregory P. Smith 53ec8ae6a5 re.escape os.sep so that \ is interpreted properly in the regex. 2012-02-13 16:43:55 -08:00
Gregory P. Smith a127ecb7a2 import re for the previous commit. 2012-02-13 16:41:20 -08:00
Gregory P. Smith 9903c705b8 re.escape os.sep so that \ is interpreted properly in the regex. 2012-02-13 16:38:37 -08:00
Gregory P. Smith aed5553932 Issue #13930: fix a / to use os.sep so that the test works on Windows. 2012-02-13 16:26:50 -08:00
Gregory P. Smith 93b98ca445 Issue #13930: fix a / to use os.sep so that the test works on Windows. 2012-02-13 16:24:46 -08:00
Victor Stinner 3634bfbee6 lib2to3 tests: Don't use deprecated API, switch to assertRegex() 2012-02-13 23:31:26 +01:00
Ezio Melotti 5e4d908704 Merge the indexfix and comments clean up. 2012-02-13 20:28:46 +02:00
Ezio Melotti e31ddedb0e Fix an index and clean up comments. 2012-02-13 20:20:00 +02:00
Ezio Melotti 610a0b673e Merge fix for HTMLParser and improvements in declarations handling. 2012-02-13 15:52:25 +02:00
Ezio Melotti f4ab491901 Improve handling of declarations in HTMLParser. 2012-02-13 15:50:37 +02:00
Ezio Melotti 86f67123be Fix htmlparser tests to always use the right collector. 2012-02-13 14:11:27 +02:00
Florent Xicluna 6c3da6ebc2 Fix xml_etree_c test error (follow up of issue #13988). 2012-02-13 12:14:52 +01:00
Florent Xicluna a72a98f24a Issue #13988: cElementTree is deprecated and the _elementtree accelerator is automatically used whenever available. 2012-02-13 11:03:30 +01:00
Ezio Melotti d1c7b1afe8 #13993: merge with 3.2. 2012-02-13 11:42:29 +02:00
Ezio Melotti 5211ffe4df #13993: HTMLParser is now able to handle broken end tags when strict=False. 2012-02-13 11:24:50 +02:00
Gregory P. Smith 3dc74c0a9d fix whitespace normalization before pushing. 2012-02-12 15:59:00 -08:00
Gregory P. Smith efc66f9e36 fix whitespace normalization before pushing. 2012-02-12 15:58:36 -08:00
Gregory P. Smith db66310e8f Issue #13930: Adds ability for 2to3 to write its output to a different
directory tree instead of overwriting the input files.  Adds three command
line options: -o/--output-dir, -W/--write-unchanged-files and --add-suffix.
2012-02-12 15:56:49 -08:00
Gregory P. Smith 58f23ffb21 Issue #13930: Adds ability for 2to3 to write its output to a different
directory tree instead of overwriting the input files.  Adds three command
line options: -o/--output-dir, -W/--write-unchanged-files and --add-suffix.

Feature backports into stable release branches for 2to3 are allowed by
a special exemption:
 http://mail.python.org/pipermail/python-dev/2011-December/115089.html
2012-02-12 15:50:21 -08:00
Petri Lehtinen c7551a16c7 Merge branch '3.2'
Closes #9750
2012-02-12 21:06:57 +02:00
Petri Lehtinen 51d04d1ba8 Fix sqlite3.Connection.iterdump on tables/fields with reserved names or quotes
Closes #9750
2012-02-12 21:05:31 +02:00
Antoine Pitrou 425b8e85a9 Issue #10287: nntplib now queries the server's CAPABILITIES again after authenticating (since the result may change, according to RFC 4643).
Patch by Hynek Schlawack.
2012-02-12 19:15:09 +01:00
Antoine Pitrou 54411c1784 Issue #10287: nntplib now queries the server's CAPABILITIES again after authenticating (since the result may change, according to RFC 4643).
Patch by Hynek Schlawack.
2012-02-12 19:14:17 +01:00
Ross Lagerwall 2f234db3eb Merge with remote. 2012-02-12 11:13:06 +02:00
Ross Lagerwall 003c7a3fca Fix a typo. 2012-02-12 09:02:01 +02:00
Ross Lagerwall ab66d2a6cb Attempt to speed up some subprocess tests (and hopefully keep them reliable). 2012-02-12 09:01:30 +02:00
Éric Araujo b9df745ab5 Port the fix for #13193 to packaging 2012-02-12 05:01:42 +01:00
Éric Araujo a9d2b64206 Merge fixes for #13193 and FAQ from 3.2 2012-02-12 04:58:46 +01:00
Éric Araujo 9ce366a5a6 Fix distutils.filelist.FileList under Windows (#13193).
The code used to call os.path.join to build a regex but without escaping
the backslash, which lead to test failures on Windows.  Antoine Pitrou
fixed it in 0a94e2f807c7 by enhancing the code to accept both / and \,
with proper escaping, but in my opinion this goes against the distutils
feature freeze, hence this change.
2012-02-12 04:52:21 +01:00
Nadeem Vawda ae557d767f Fix seekable() in BZ2File and LZMAFile to check whether the underlying file supports seek(). 2012-02-12 01:51:38 +02:00
Nadeem Vawda be66af424b Clean up GzipFile mode string handling code. 2012-02-12 00:06:02 +02:00
Nadeem Vawda d1a107132c Merge: #13989: Document that GzipFile does not support text mode. 2012-02-11 23:54:51 +02:00
Nadeem Vawda 30d94b7aea Issue #13989: Document that GzipFile does not support text mode.
Also, give a more helpful error message when opened with an invalid mode string.
2012-02-11 23:45:10 +02:00
Florent Xicluna f4bdf4e478 Issue #13988: move the python bootstrap code to cElementTree.py, and remove obsolete code for Python 2.4 and 2.5. 2012-02-11 11:28:16 +01:00
Philip Jenvey 353c10772a simplify 2012-02-10 11:45:03 -08:00
Ned Deily 7347df1504 Issue #13590: merge 2012-02-10 13:08:44 +01:00
Ned Deily 9937748f0c Issue #13590: On OS X 10.7 and 10.6 with Xcode 4.2, building
Distutils-based packages with C extension modules may fail because
Apple has removed gcc-4.2, the version used to build python.org
64-bit/32-bit Pythons.  If the user does not explicitly override
the default C compiler by setting the CC environment variable,
Distutils will now attempt to compile extension modules with clang
if gcc-4.2 is required but not found. Also as a convenience, if
the user does explicitly set CC, substitute its value as the default
compiler in the Distutils LDSHARED configuration variable for OS X.
(Note, the python.org 32-bit-only Pythons use gcc-4.0 and the 10.4u
SDK, neither of which are available in Xcode 4.  This change does not
attempt to override settings to support their use with Xcode 4.)
2012-02-10 13:01:08 +01:00
Ezio Melotti 176630ec19 #13960: merge with 3.2. 2012-02-10 10:50:49 +02:00
Ezio Melotti fa3702dc28 #13960: HTMLParser is now able to handle broken comments when strict=False. 2012-02-10 10:45:44 +02:00
Éric Araujo 9f90a731eb Use sys.version_info instead of sys.version in packaging.
The contents of this attribute are an implementation detail, as
documented for #9442, so we should not parse it, to support non-CPython
VMs with distutils2 in the future.

Unfortunately, one use comes directly from PEP 345, so an edit will have
to be agreed before fixing the code (see comment in p7g.markers).

Other remaining uses are found in p7g.compiler and could be replaced by
the platform module (which also parses sys.version, but then it wouldn’t
be my fault :)
2012-02-10 05:20:53 +01:00
Éric Araujo ea0b1edf45 Branch merge 2012-02-10 05:12:58 +01:00
Éric Araujo 692a49394d Start improving 2to3 code in packaging (#13462).
- Change the fixers used in tests to something not provided by lib2to3
- Test conversion of doctests in text files
- Factor out test boilerplate into a common method
2012-02-09 21:37:14 +01:00
Éric Araujo 1a765f5d9d Synchronize packaging.tests.support with distutils2 2012-02-09 21:30:25 +01:00
Éric Araujo 6e1f564efa More boolean tests for packaging metadata environment markers 2012-02-09 21:18:26 +01:00
Éric Araujo ac03a2b089 Remove unneeded import 2012-02-09 21:17:46 +01:00
Petri Lehtinen bc35bebb45 Undocument and clean up sqlite3.OptimizedUnicode
Closes #13921.
2012-02-09 21:09:03 +02:00
Éric Araujo 5c69b66086 Group commands by topic in “pysetup run --list-commands” output.
This fixes a regression from distutils, where “setup.py --help-commands”
prints out commands grouped by topic (i.e. building vs. installing),
which is more useful than using sorted.
2012-02-09 14:29:11 +01:00
Brett Cannon 4a2e1a0da7 Undo a bad mq management thingy. 2012-02-08 19:11:53 -05:00
Brett Cannon 97771096ab Whitespace normalization. 2012-02-08 18:55:37 -05:00
Brett Cannon b4e63b3177 Use the cwd when the empty string is found in sys.path. This leads to
__file__ being an absolute path when the module is found in the
current directory.
2012-02-08 18:52:56 -05:00
Brett Cannon 354c26ecd6 Move setup code from importlib.__init__ to
importlib._bootstrap._setup().
2012-02-08 18:50:22 -05:00
Brett Cannon 8490fab4ad Don't fail in the face of a lacking attribute when wrapping a
function.
2012-02-08 18:44:14 -05:00
Antoine Pitrou 81a1fa5c77 get_terminal_size() can also fail with ENOTTY if the fd is not connected to a terminal. 2012-02-09 00:11:00 +01:00
Antoine Pitrou cfade36227 Relax tests to fix buildbot failure 2012-02-08 23:48:59 +01:00
Antoine Pitrou bcf2b59fb5 Issue #13609: Add two functions to query the terminal size:
os.get_terminal_size (low level) and shutil.get_terminal_size (high level).
Patch by Zbigniew Jędrzejewski-Szmek.
2012-02-08 23:28:36 +01:00
Victor Stinner 4195b5caea Backout f8409b3d6449: the PEP 410 is not accepted yet 2012-02-08 23:03:19 +01:00
Charles-François Natali b2c9e9ad91 Skip test_threading.test_reinit_tls_after_fork() on platforms where fork()
can't be called reliably from a worker thread.
2012-02-08 21:29:11 +01:00
Victor Stinner ccd5715a14 PEP 410 2012-02-08 14:31:50 +01:00
Charles-François Natali 6f91ce74a0 Skip test_threading.test_reinit_tls_after_fork() on platforms where fork()
can't be called reliably from a worker thread.
2012-02-08 21:30:02 +01:00
Charles-François Natali ed4a8fc095 Issue #8184: multiprocessing: On Windows, don't set SO_REUSEADDR on Connection
sockets, and set FILE_FLAG_FIRST_PIPE_INSTANCE on named pipes, to make sure two
listeners can't bind to the same socket/pipe (or any existing socket/pipe).
2012-02-08 21:15:58 +01:00
Victor Stinner 1aa54a417d Issue #13964: Skip os.*utime*() tests if os.stat() doesn't support timestamp
with a subsecond resolution
2012-02-08 04:09:37 +01:00
Victor Stinner a2f7c00638 Issue #13964: Split os.*utime*() subsecond tests into multiple tests to help
debugging
2012-02-08 03:36:25 +01:00
Victor Stinner 8b6f10dda2 Issue #13964: Test also os.futimesat() 2012-02-08 03:07:25 +01:00
Victor Stinner be557dedf9 Issue #13964: Write tests for new os.*utime*() functions 2012-02-08 03:01:11 +01:00
Victor Stinner 8b30201f7d Issue #13846: Add time.monotonic(), monotonic clock. 2012-02-07 23:29:46 +01:00