Commit Graph

17927 Commits

Author SHA1 Message Date
Brett Cannon ed05b8a1a1 Issue #19712: Port test.test_importlib.import_ tests to use PEP 451
that don't require changing test.test_importlib.util.mock_modules().
2013-11-29 16:17:05 -05:00
Brett Cannon d2476c6e4b Issue #19698: Remove exec_module() from the built-in and extension
module loaders.

Due to the fact that the call signatures for extension modules and
built-in modules does not allow for the specifying of what module to
initialize and that on Windows all extension modules are built-in
modules, work to clean up built-in and extension module initialization
will have to wait until Python 3.5. Because of this the semantics of
exec_module() would be incorrect, so removing the methods for now is
the best option; load_module() is still used as a fallback by
importlib and so this won't affect semantics.
2013-11-29 11:00:11 -05:00
Eli Bendersky 8148164353 Issue #19815: Fix segfault when parsing empty namespace declaration.
Based on patches by Christian Heimes and Vajrasky Kok
2013-11-28 06:35:40 -08:00
Eli Bendersky 5dd40e555b Issue #19815: Fix segfault when parsing empty namespace declaration.
Based on patches by Christian Heimes and Vajrasky Kok
2013-11-28 06:31:58 -08:00
Zachary Ware 04a684b2f2 Issue #19595: Re-enable a long-disabled test in test_winsound 2013-11-27 23:56:04 -06:00
Zachary Ware 50a5dad608 Issue #19595: Re-enable a long-disabled test in test_winsound 2013-11-27 23:56:04 -06:00
Guido van Rossum a5062c5d81 asyncio: Change write buffer use to avoid O(N**2). Make write()/sendto() accept bytearray/memoryview too. Change some asserts with proper exceptions. 2013-11-27 14:12:48 -08:00
Victor Stinner f28ce60441 Closes #19786: tracemalloc, remove the arbitrary limit of 100 frames
The limit is now 178,956,969 on 64 bit (it is greater on 32 bit because
structures are smaller).

Use int instead of Py_ssize_t to store the number of frames to have smaller
traceback_t objects.
2013-11-27 22:27:13 +01:00
Victor Stinner 3c0481d426 Close #19798: replace "maximum" term with "peak" in get_traced_memory()
documentation. Use also the term "current" for the current size.
2013-11-27 21:39:49 +01:00
Guido van Rossum cced076218 asyncio: Fix get_event_loop() to call set_event_loop() when setting the loop. By Anthony Baire. 2013-11-27 10:37:13 -08:00
Serhiy Storchaka ba9d75e1be Skip test_find_mac on Windows (issue #19804).
This test requires the ifconfig executable on $PATH, /sbin/, or /usr/sbin.
2013-11-27 08:58:13 +02:00
Serhiy Storchaka c303cfdb8a Skip test_find_mac on Windows (issue #19804).
This test requires the ifconfig executable on $PATH, /sbin/, or /usr/sbin.
2013-11-27 08:57:51 +02:00
Benjamin Peterson d75803c1fc merge 3.3 (#19729) 2013-11-26 19:24:01 -06:00
Benjamin Peterson 0ee22bf774 fix format spec recursive expansion (closes #19729) 2013-11-26 19:22:36 -06:00
Zachary Ware 910b1c3993 Merge heads 2013-11-26 14:57:45 -06:00
Zachary Ware 99fb0513dd Merge heads 2013-11-26 14:57:10 -06:00
Zachary Ware 29f8cb64e6 Issue #19588: Merge with 3.3 2013-11-26 14:54:21 -06:00
Zachary Ware a6edea530b Issue #19588: Fixed tests in test_random that were silently skipped most
of the time.  Patch by Julian Gindi.
2013-11-26 14:50:10 -06:00
Serhiy Storchaka 822963ed5d Issue #11508: Fixed uuid.getnode() and uuid.uuid1() on environment with
virtual interface.  Original patch by Kent Frazier.
2013-11-26 22:49:36 +02:00
Serhiy Storchaka 56507c7862 Issue #11508: Fixed uuid.getnode() and uuid.uuid1() on environment with
virtual interface.  Original patch by Kent Frazier.
2013-11-26 22:47:16 +02:00
Mark Dickinson 518e6ee98b Use @bigmemtest more accurately. 2013-11-26 20:29:06 +00:00
Mark Dickinson a04f4e0374 Use @bigmemtest more accurately. 2013-11-26 20:28:29 +00:00
Serhiy Storchaka 687ff0ecdf Issue #11489: JSON decoder now accepts lone surrogates. 2013-11-26 21:27:11 +02:00
Serhiy Storchaka c93329b3dd Issue #11489: JSON decoder now accepts lone surrogates. 2013-11-26 21:25:28 +02:00
Mark Dickinson 1df88677e9 Issue #19638: Merge from 3.3 2013-11-26 16:19:38 +00:00
Mark Dickinson f45bbb6211 Issue #19638: Raise ValueError instead of crashing when converting billion character strings to float. 2013-11-26 16:19:13 +00:00
Serhiy Storchaka eaec3597dd Issue #19760: Silence sysconfig's 'SO' key deprecation warnings in tests.
Change stacklevel in warnings.warn() for 'SO' key to 2.
2013-11-26 17:08:24 +02:00
Christian Heimes ad39360a02 Fix suspicious test case 2013-11-26 01:32:15 +01:00
Antoine Pitrou 2cf4b0f159 Issue #19742: fix a test_pathlib failure when a file owner or group isn't in the system database 2013-11-25 19:51:53 +01:00
Guido van Rossum 27bfe468cc asyncio: Hopeful fix for issue 19765. 2013-11-25 10:06:34 -08:00
Guido van Rossum 14c3e14053 asyncio: Change mock pipe to mock socket. Hope to fix issue 19750. 2013-11-25 09:43:52 -08:00
Victor Stinner 23ed7e3d12 Issue #19753: New try to fix test_gdb on System Z buildbot 2013-11-25 10:43:59 +01:00
Victor Stinner a89ecc7d23 Cleanup test_tracemalloc.py. Patch written by Vajrasky Kok. 2013-11-25 09:29:45 +01:00
Christian Heimes 217f5c4eda Issue #19758: silence PendingDeprecationWarnings in test_hmac
I also removed some bare excepts from the tests.
2013-11-24 23:14:16 +01:00
Serhiy Storchaka 2480c2ed59 Issue #15204: Silence and check the 'U' mode deprecation warnings in tests.
Changed deprecation message in the fileinput module.
2013-11-24 23:13:26 +02:00
Stefan Krah daa96b7669 Merge from 3.3. 2013-11-24 19:56:23 +01:00
Stefan Krah 45059eb1d0 1) Prepare libmpdec for the 2.4.0 release. None of the following changes affects
_decimal:

      o Make all "mpd_t to C integer" conversion functions available in both the
        64-bit and the 32-bit versions.

      o Make all mixed mpd_t/C integer arithmetic functions available in the
        32-bit version.

      o Better handling of __STDC_LIMIT_MACROS for C++ users.

      o Add struct tags (at the request of C++ users).

2) Check for libmpdec.so.2 if --with-system-libmpdec is used.
2013-11-24 19:44:57 +01:00
Victor Stinner f4a4898c18 Issue #19753: Try to fix test_gdb on SystemZ buildbot 2013-11-24 18:55:25 +01:00
Serhiy Storchaka b5d386314f Issue #19545: Avoid chained exceptions while passing stray % to
time.strptime().  Initial patch by Claudiu Popa.
2013-11-24 18:17:11 +02:00
Serhiy Storchaka cdac302af3 Issue #19545: Avoid chained exceptions while passing stray % to
time.strptime().  Initial patch by Claudiu Popa.
2013-11-24 18:15:37 +02:00
Antoine Pitrou a8892a1aa5 Issue #19743: fix test_gdb on some optimized Python builds 2013-11-24 14:58:17 +01:00
Antoine Pitrou f6eb31fdc6 Issue #19743: fix test_gdb on some optimized Python builds 2013-11-24 14:58:17 +01:00
Antoine Pitrou 3ab9cfc501 Selectively re-enable framing tests 2013-11-24 14:33:37 +01:00
Zachary Ware 7119b454fd Issue #3158: Relax new doctests a bit.
Apparently, the number of objects with docstrings in builtins varies
with --with-pydebug (non-debug has one fewer).

Also, skip the new tests entirely if built --without-doc-strings.
2013-11-24 02:21:57 -06:00
Zachary Ware fe94d8adfc Merge heads 2013-11-24 01:20:14 -06:00
Zachary Ware a4b7a7548c Issue #3158: doctest can now find doctests in functions and methods
written in C.

As a part of this, a few doctests have been added to the builtins module
(on hex(), oct(), and bin()), a doctest has been fixed (hopefully on all
platforms) on float, and test_builtins now runs doctests in builtins.
2013-11-24 01:19:09 -06:00
Nick Coghlan 1d1d834328 Issue #19734: Also run pip version check in isolated mode 2013-11-24 16:49:20 +10:00
Nick Coghlan 091167c1ca Issue #19734: Ensure test_venv ignores PIP_REQUIRE_VIRTUALENV 2013-11-24 14:58:31 +10:00
Alexandre Vassalotti 5e411b7035 Disable annoying tests which doesn't work optimized pickles. 2013-11-23 20:58:24 -08:00
Alexandre Vassalotti b6a2f2a0d1 Make framing optional in pickle protocol 4.
This will allow us to control in the future whether to use framing or not.
For example, we may want to turn it off for tiny pickle where it doesn't
help.

The change also improves performance slightly:

### fastpickle ###
Min: 0.608517 -> 0.557358: 1.09x faster
Avg: 0.798892 -> 0.694738: 1.15x faster
Significant (t=3.45)
Stddev: 0.17145 -> 0.12704: 1.3496x smaller
Timeline: http://goo.gl/3xQE1J

### pickle_dict ###
Min: 0.669920 -> 0.615271: 1.09x faster
Avg: 0.733633 -> 0.645058: 1.14x faster
Significant (t=5.05)
Stddev: 0.12041 -> 0.02961: 4.0662x smaller
Timeline: http://goo.gl/LpLSXI

### pickle_list ###
Min: 0.397583 -> 0.368112: 1.08x faster
Avg: 0.412784 -> 0.397223: 1.04x faster
Significant (t=2.78)
Stddev: 0.01518 -> 0.03653: 2.4068x larger
Timeline: http://goo.gl/v39E59

### unpickle_list ###
Min: 0.692935 -> 0.594870: 1.16x faster
Avg: 0.730012 -> 0.628395: 1.16x faster
Significant (t=17.76)
Stddev: 0.02720 -> 0.02995: 1.1012x larger
Timeline: http://goo.gl/2P9AEt

The following not significant results are hidden, use -v to show them:
fastunpickle.
2013-11-23 20:30:03 -08:00
Nick Coghlan 878d258a22 Issue #19744 (temp workaround): without ssl, skip pip test 2013-11-24 12:45:25 +10:00
Nick Coghlan 6fd12f2b33 Issue 19734: better diagnostics for test_venv failures 2013-11-24 11:36:31 +10:00
Larry Hastings fcafe43320 Fix inspect.signature tests for builtins when docstrings are compiled out. 2013-11-23 17:35:48 -08:00
Antoine Pitrou 3b7b1e533e Try to fix test_tarfile under Windows 2013-11-24 01:55:05 +01:00
Serhiy Storchaka 5e8c8091ee Build a list of supported test tarfiles dynamically for CLI "test" command
tests (issue13477).
2013-11-24 02:30:59 +02:00
Larry Hastings c8635b4192 Don't attempt to run the _opcode test if it wasn't built. 2013-11-23 16:11:17 -08:00
Serhiy Storchaka d27b455bbc Issue #13477: Added command line interface to the tarfile module.
Original patch by Berker Peksag.
2013-11-24 01:53:29 +02:00
Larry Hastings 44e2eaab54 Issue #19674: inspect.signature() now produces a correct signature
for some builtins.
2013-11-23 15:37:55 -08:00
Guido van Rossum 085869bfee asyncio: Change bounded semaphore into a subclass, like threading.[Bounded]Semaphore. 2013-11-23 15:09:16 -08:00
Larry Hastings 3a9079742f Issue #19722: Added opcode.stack_effect(), which accurately
computes the stack effect of bytecode instructions.
2013-11-23 14:49:22 -08:00
Christian Heimes 67986f9431 Issue #19735: Implement private function ssl._create_stdlib_context() to
create SSLContext objects in Python's stdlib module. It provides a single
configuration point and makes use of SSLContext.load_default_certs().
2013-11-23 22:43:47 +01:00
Serhiy Storchaka 32eddc1bbc Issue #16203: Add re.fullmatch() function and regex.fullmatch() method,
which anchor the pattern at both ends of the string to match.

Original patch by Matthew Barnett.
2013-11-23 23:20:30 +02:00
Serhiy Storchaka 5c24d0e504 Issue #13592: Improved the repr for regular expression pattern objects.
Based on patch by Hugo Lopes Tavares.
2013-11-23 22:42:43 +02:00
Antoine Pitrou d5df19461d test_pickle: speed up test_long 2013-11-23 21:20:49 +01:00
Serhiy Storchaka 3062c9a6c8 Issue #19641: Added the audioop.byteswap() function to convert big-endian
samples to little-endian and vice versa.
2013-11-23 22:26:01 +02:00
Serhiy Storchaka dd52c5a1c4 Merge heads 2013-11-23 22:12:36 +02:00
Serhiy Storchaka 6787a3806e Issue #15204: Deprecated the 'U' mode in file-like objects. 2013-11-23 22:12:06 +02:00
Antoine Pitrou 8f2ee6e407 Fix writing out 64-bit size fields on 32-bit builds 2013-11-23 21:05:08 +01:00
Guido van Rossum d41c343f28 asyncio: Use socketpair() from test_utils in tests (Saúl Ibarra Corretgé). 2013-11-23 11:51:53 -08:00
Antoine Pitrou 7cd9fbe087 Fix whitespace 2013-11-23 19:01:36 +01:00
Antoine Pitrou c9dc4a2a8a Issue #17810: Implement PEP 3154, pickle protocol 4.
Most of the work is by Alexandre.
2013-11-23 18:59:12 +01:00
Ezio Melotti 95401c5f6b #13633: Added a new convert_charrefs keyword arg to HTMLParser that, when True, automatically converts all character references. 2013-11-23 19:52:05 +02:00
Guido van Rossum 94097b02c2 Relax timing even more, hopefully again fixes issue 19579. 2013-11-23 09:20:12 -08:00
Serhiy Storchaka 434d27a490 Merge heads 2013-11-23 19:08:38 +02:00
Victor Stinner 0da64f7ffb Isue #19634: test_y_before_1900() is expected to fail on Solaris 2013-11-23 17:58:26 +01:00
Serhiy Storchaka be0c3250b1 Issue #19668: Added support for the cp1125 encoding. 2013-11-23 18:52:23 +02:00
Antoine Pitrou b17d2aa552 Issue #19308: fix the gdb plugin on gdbs linked with Python 3 2013-11-23 17:40:36 +01:00
Antoine Pitrou e50240c504 Issue #19308: fix the gdb plugin on gdbs linked with Python 3 2013-11-23 17:40:36 +01:00
Christian Heimes 5de397e158 merge 2013-11-23 15:59:07 +01:00
Christian Heimes 4c05b472dd Issue #19689: Add ssl.create_default_context() factory function. It creates
a new SSLContext object with secure default settings.
2013-11-23 15:58:30 +01:00
Antoine Pitrou 2cf3917954 Issue #19715: try the utime(..., None) approach again, now that it should be more precise under Windows 2013-11-23 15:25:59 +01:00
Serhiy Storchaka 235c5e0dd6 Issue #17201: ZIP64 extensions now are enabled by default.
Patch by William Mallard.
2013-11-23 15:55:38 +02:00
Antoine Pitrou 8b78493d4f Issue #19716: add a test that Path.touch() doesn't change a file's contents.
Patch by Kushal Das.
2013-11-23 14:52:39 +01:00
Christian Heimes 72d28500b3 Issue #19292: Add SSLContext.load_default_certs() to load default root CA
certificates from default stores or system stores. By default the method
loads CA certs for authentication of server certs.
2013-11-23 13:56:58 +01:00
Victor Stinner 3728d6ced0 Issue #18874: Remove tracemalloc.set_traceback_limit()
tracemalloc.start() now has an option nframe parameter
2013-11-23 12:37:20 +01:00
Victor Stinner ed3b0bca3e Issue #18874: Implement the PEP 454 (tracemalloc) 2013-11-23 12:27:24 +01:00
Christian Heimes 2427b50fdd Issue #8813: X509_VERIFY_PARAM is only available on OpenSSL 0.9.8+
The patch removes the verify_flags feature on Mac OS X 10.4 with OpenSSL 0.9.7l 28 Sep 2006.
2013-11-23 11:24:32 +01:00
Nick Coghlan d76cdc161e Close #19694: venv now runs ensurepip in isolated mode 2013-11-23 11:37:28 +10:00
Nick Coghlan 9c1aed8f94 Close #7475: Restore binary & text transform codecs
The codecs themselves were restored in Python 3.2, this
completes the restoration by adding back the convenience
aliases.

These aliases were originally left out due to confusing
errors when attempting to use them with the text encoding
specific convenience methods. Python 3.4 includes several
improvements to those errors, thus permitting the aliases
to be restored as well.
2013-11-23 11:13:36 +10:00
Antoine Pitrou 12820c0d5d Revert utime(..., None) strategy (it has too poor resolution under Windows) and restore the previous test workaround
(issue #19715)
2013-11-23 02:11:02 +01:00
Antoine Pitrou c3055be5f3 Trying other strategy for #19715: use utime(..., None) 2013-11-23 01:54:27 +01:00
Antoine Pitrou bb6694de85 Try to fix issue #19715 (timestamp rounding inconsistencies under Windows?) 2013-11-23 01:32:53 +01:00
Victor Stinner 6c86181cd1 Issue #19715: Ensure that consecutive calls to monotonic() are monotonic 2013-11-23 00:15:27 +01:00
Antoine Pitrou 0f57564cac Try to debug issue #19715 2013-11-22 23:20:08 +01:00
Antoine Pitrou 2dd38fb238 Issue #19718: add one more globbing test under POSIX 2013-11-22 22:26:01 +01:00
Brett Cannon 02ac74eecc merge 2013-11-22 16:14:24 -05:00
Brett Cannon fe77f4ebb5 Issue #19718: Add a case-insensitive FS check to test.support to use
in test_pathlib.

Purposefully designed to work from a specified directory in case
multiple file systems are used on the system.
2013-11-22 16:14:10 -05:00
Eric Snow 2ba66ebc20 Issue #19724: clear out colliding temp module. 2013-11-22 13:55:23 -07:00
Guido van Rossum 7a465647e4 asyncio: Pass cancellation from wrapping Future to wrapped Future. By Saúl Ibarra Corretgé (mostly). 2013-11-22 11:47:22 -08:00
Brett Cannon 873d1226b7 Make test_importlib output easier to trace back to the failing test
class.
2013-11-22 14:47:09 -05:00