Commit Graph

20416 Commits

Author SHA1 Message Date
Florent Xicluna 8cf4b51fa4 xml.dom.minidom: add more __slots__ to limit resource usage. 2012-03-05 12:37:02 +01:00
Florent Xicluna 6c75301eb6 xml.dom: fix typo, drop unused imports. 2012-03-05 12:35:15 +01:00
Florent Xicluna fb06746852 Flatten nested try ... finally, try ... except. 2012-03-05 11:42:49 +01:00
Stefan Krah 49ab14f452 Merge. 2012-03-05 10:50:11 +01:00
Stefan Krah fcbb4169b9 Issue #10181: The decision was to raise a buffer error in memory_exit()
if the view has exported buffers. Make this official by uncommenting
a test case.
2012-03-05 10:45:31 +01:00
Vinay Sajip 682c979871 Merged upstream changes. 2012-03-05 09:44:25 +00:00
Vinay Sajip b6f6670d87 Added more diagnostics for diagnosing #12151. 2012-03-05 09:43:47 +00:00
Florent Xicluna 75b5e7ee15 Issue #14007: accept incomplete TreeBuilder objects (missing start/end/data/close) for the Python implementation as well. Add disabled tests for the doctype() method. 2012-03-05 10:42:19 +01:00
Stefan Krah 4e99a315b7 Issue #14181: Allow memoryview construction from an object that uses the
getbuffer redirection scheme.
2012-03-05 09:30:47 +01:00
Martin v. Löwis 67245a6ed4 Issue #14168: Check for presence of _attrs before accessing it. 2012-03-05 07:01:49 +01:00
Meador Inge f1c42599ba Issue #14195: Make WeakSet.__lt__ and WeakSet.__gt__ irreflexive. 2012-03-04 22:40:15 -06:00
Meador Inge 653f932eff Issue #14195: Make WeakSet.__lt__ and WeakSet.__gt__ irreflexive. 2012-03-04 22:15:38 -06:00
Antoine Pitrou 5102bf476c Fix some set algebra methods of WeakSet objects. 2012-03-04 21:16:52 +01:00
Antoine Pitrou f7dabd849f Merge 2012-03-04 20:59:01 +01:00
Antoine Pitrou a14bd00542 Port 2.7 fix for sporadic failure in test_weakset. 2012-03-04 20:55:35 +01:00
Antoine Pitrou 9c47ac05d1 Fix some set algebra methods of WeakSet objects. 2012-03-04 20:47:05 +01:00
Georg Brandl 0b2b583ea2 Fix spelling. 2012-03-04 20:36:28 +01:00
Antoine Pitrou de89d4b097 Port 2.7 fix for sporadic failure in test_weakset. 2012-03-04 20:20:34 +01:00
Antoine Pitrou 8d3c290de4 Issue #14166: Pickler objects now have an optional `dispatch_table` attribute which allows to set custom per-pickler reduction functions.
Patch by sbt.
2012-03-04 18:31:48 +01:00
Georg Brandl 6c8850d94d Bump to 3.3.0a1. 2012-03-04 16:23:53 +01:00
Georg Brandl 0f25cea2c5 Regenerate pydoc topics. 2012-03-04 16:12:09 +01:00
Armin Ronacher c0eaecafe9 Updated tokenize to support the inverse byte literals new in 3.3 2012-03-04 13:07:57 +00:00
Armin Ronacher 6ecf77b3f8 Basic support for PEP 414 without docs or tests. 2012-03-04 12:04:06 +00:00
Eli Bendersky 745ccf8b1a fix trailing whitespace 2012-03-04 07:15:21 +02:00
Eli Bendersky 092af1fc5c Issue #14128: Exposing Element as an actual type from _elementtree, rather than a factory function.
This makes the C implementation more aligned with the Python implementation.
Also added some tests to ensure that Element is now a type and that it can
be subclassed.
2012-03-04 07:14:03 +02:00
Vinay Sajip d263d18553 Fixed problem with diagnostic output. 2012-03-03 16:20:37 +00:00
Antoine Pitrou 0d3a003f24 - Issue #14177: marshal.loads() now raises TypeError when given an unicode
string.  Patch by Guilherme Gonçalves.
2012-03-03 02:38:37 +01:00
Antoine Pitrou 4a90ef0363 Issue #14177: marshal.loads() now raises TypeError when given an unicode string.
Patch by Guilherme Gonçalves.
2012-03-03 02:35:32 +01:00
Victor Stinner 135b6d8aa5 Close #13550: Remove the debug machinery from the threading module: remove
verbose arguments from all threading classes and functions.
2012-03-03 01:32:57 +01:00
Victor Stinner 643cd68ea4 Issue #13964: signal.sigtimedwait() timeout is now a float instead of a tuple
Add a private API to convert an int or float to a C timespec structure.
2012-03-02 22:54:03 +01:00
Brett Cannon 0d4d410b2d Remove a dead docstring. 2012-03-02 12:32:14 -05:00
Antoine Pitrou b2677c7397 Issue #14172: Fix reference leak when marshalling a buffer-like object (other than a bytes object). 2012-03-02 18:16:38 +01:00
Antoine Pitrou 679e9d36f7 Issue #14172: Fix reference leak when marshalling a buffer-like object (other than a bytes object). 2012-03-02 18:12:43 +01:00
Vinay Sajip 2f24d98df0 Closes #14158: merged test file resilience fix from 3.2. 2012-03-02 01:24:13 +00:00
Vinay Sajip f959618142 Closes #14158: improved resilience to test files left behind. 2012-03-02 01:01:13 +00:00
Antoine Pitrou 0836baa46a Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary, WeakValueDictionary) to return a better approximation when some objects are dead or dying.
Moreover, the implementation is now O(1) rather than O(n).
Thanks to Yury Selivanov for reporting.
2012-03-01 16:28:14 +01:00
Antoine Pitrou bbe2f60b3c Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary, WeakValueDictionary) to return a better approximation when some objects are dead or dying.
Moreover, the implementation is now O(1) rather than O(n).
Thanks to Yury Selivanov for reporting.
2012-03-01 16:26:35 +01:00
Philip Jenvey d7aff2d696 update skip reason 2012-02-29 16:21:25 -08:00
Philip Jenvey e308b7c0c0 also skip test_device_encoding when stdin isn't a tty 2012-02-29 16:16:15 -08:00
Brett Cannon efb00c0cc1 Issue #14153 Create _Py_device_encoding() to prevent _io from having to import
the os module.
2012-02-29 18:31:31 -05:00
Ezio Melotti aba0b13f0a #14089: merge with 3.2. 2012-02-29 14:06:56 +02:00
Ezio Melotti 682d37423d #14089: increase coverage of the fractions module. Patch by Oleg Plakhotnyuk. 2012-02-29 14:05:53 +02:00
Ezio Melotti 0b8123d8ae #10713: merge with 3.2. 2012-02-29 11:49:45 +02:00
Ezio Melotti 5a045b9f54 #10713: Improve documentation for \b and \B and add a few tests. Initial patch and tests by Martin Pool. 2012-02-29 11:48:44 +02:00
Nadeem Vawda 3692453a2d Merge: Give better failure messages in test_strptime (cf. issue #14113). 2012-02-29 00:24:46 +02:00
Nadeem Vawda aba2b06001 Give better failure messages in test_strptime (cf. issue #14113). 2012-02-29 00:22:09 +02:00
Vinay Sajip 19b1d50732 Added additional diagnostics to help with #12151. 2012-02-28 19:02:43 +00:00
Brett Cannon b46a1793a7 Update importlib.invalidate_caches() to be more general. 2012-02-27 18:15:42 -05:00
Antoine Pitrou 9a4d7ddb6c More debug output 2012-02-27 22:01:25 +01:00
Antoine Pitrou ffd85c8182 Improve debugging output for test failure 2012-02-27 20:04:05 +01:00
Antoine Pitrou 049242b87c Issue #13125: Silence spurious test_lib2to3 output when in non-verbose mode.
Patch by Mikhail Novikov.
2012-02-27 19:56:37 +01:00
Antoine Pitrou d311374089 Issue #13125: Silence spurious test_lib2to3 output when in non-verbose mode.
Patch by Mikhail Novikov.
2012-02-27 19:55:36 +01:00
Éric Araujo 40e0f35ad5 Fix comparison bug with 'rc' versions in packaging.version (#11841).
I added some tests in 2105ab8553b7 and found no bug, but it turns out
that the doctest is not actually run.  While converting the doctest to
unittest style, I stumbled upon this bug again and this time applied the
code patch provided by Filip Gruszczyński.
2012-02-27 11:47:44 +01:00
Stefan Krah 0509d9418a Issue #14113: Fix a test_strptime failure caused by changes to LC_ALL. 2012-02-27 10:18:51 +01:00
Antoine Pitrou f12b4475cc Merge 2012-02-27 01:01:44 +01:00
Antoine Pitrou 70d2717f2e Issue #13521: dict.setdefault() now does only one lookup for the given key, making it "atomic" for many purposes.
Patch by Filip Gruszczyński.
2012-02-27 00:59:34 +01:00
Antoine Pitrou e965d97ed1 Issue #13521: dict.setdefault() now does only one lookup for the given key, making it "atomic" for many purposes.
Patch by Filip Gruszczyński.
2012-02-27 00:45:12 +01:00
Nadeem Vawda 05a4dd83af Issue #13873: Fix crash in test_zlib when running on a small (<4GB) tmpfs. 2012-02-27 00:42:58 +02:00
Antoine Pitrou 4f92a68a81 Issue #14080: fix sporadic test_imp failure. Patch by Stefan Krah. 2012-02-26 18:09:50 +01:00
Charles-François Natali 9578757ec4 Issue #14107: test: Fix a deadlock involving the memory watchdog thread. 2012-02-26 17:27:32 +01:00
Nick Coghlan ab7bf2143e Close issue #6210: Implement PEP 409 2012-02-26 17:49:52 +10:00
Ezio Melotti cda6b6d60d #14081: The sep and maxsplit parameter to str.split, bytes.split, and bytearray.split may now be passed as keyword arguments. 2012-02-26 09:39:55 +02:00
Éric Araujo 408026c7e8 Merge 3.2 2012-02-26 04:07:37 +01:00
Éric Araujo 7d32e7e5bc Port the #6884 fix to packaging 2012-02-26 04:01:34 +01:00
Éric Araujo 845a77205f Set archive format explicitly in one distutils test 2012-02-26 02:14:33 +01:00
Éric Araujo f71654521b Merge from 3.2 2012-02-25 17:26:44 +01:00
Éric Araujo b46562480b Add test file for scripts in Tools (#13447).
When people find bugs in scripts such as reindent.py, msgfmt.py or
pygettext.py, we have to try to reproduce the bug manually, apply a fix
and test manually again.  The alternative is to only read the code and
trust that it works.  This test file is a way to stop that
unsatisfactory state of things and write proper unit tests instead.
2012-02-25 16:57:04 +01:00
Éric Araujo c071a613df Merge 3.2 2012-02-25 16:32:18 +01:00
Éric Araujo 2e0a0e1640 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 0a94e2f807c7 and
90b30d62caf2 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.
2012-02-25 16:28:05 +01:00
Nadeem Vawda afdac030e3 Use assertEqual in test_strptime for better failure messages (cf. issue #14113). 2012-02-25 15:58:36 +02:00
Stefan Krah 9a2d99e28a - Issue #10181: New memoryview implementation fixes multiple ownership
and lifetime issues of dynamically allocated Py_buffer members (#9990)
  as well as crashes (#8305, #7433). Many new features have been added
  (See whatsnew/3.3), and the documentation has been updated extensively.
  The ndarray test object from _testbuffer.c implements all aspects of
  PEP-3118, so further development towards the complete implementation
  of the PEP can proceed in a test-driven manner.

  Thanks to Nick Coghlan, Antoine Pitrou and Pauli Virtanen for review
  and many ideas.

- Issue #12834: Fix incorrect results of memoryview.tobytes() for
  non-contiguous arrays.

- Issue #5231: Introduce memoryview.cast() method that allows changing
  format and shape without making a copy of the underlying memory.
2012-02-25 12:24:21 +01:00
Philip Jenvey 4b42ff609d unused imports, pep8 2012-02-24 21:48:17 -08:00
Victor Stinner 6f73874edd Close #14095: type.__new__() doesn't remove __qualname__ key from the class
dict anymore if the key is present. Reject also non-string qualified names.
And fix reference leaks in type.__new__().
2012-02-25 01:22:36 +01:00
Victor Stinner abc649ddbe Issue #14107: fix bigmem tests on str.capitalize(), str.swapcase() and
str.title(). Compute correctly how much memory is required for the test
(memuse).
2012-02-25 00:43:27 +01:00
Benjamin Peterson ab5a044aec merge 3.2.2 release branch for rc 2012-02-24 11:47:29 -05:00
Brett Cannon 625cd23da4 Simplify importib._resolve_name(). 2012-02-24 11:20:54 -05:00
Ezio Melotti 91932da338 #13973: move a couple of imports at module level. Patch by Tshepang Lekhonkhobe. 2012-02-24 12:44:04 +02:00
Brett Cannon 2fe4bb10e7 merge 2012-02-23 20:48:13 -05:00
Brett Cannon 4b03b68635 Turn _return_module() into _handle_fromlist(). 2012-02-23 20:47:57 -05:00
Victor Stinner 90f50d4df9 Issue #13706: Fix format(float, "n") for locale with non-ASCII decimal point (e.g. ps_aF) 2012-02-24 01:44:47 +01:00
Brett Cannon 6858cabb26 merge 2012-02-23 19:34:55 -05:00
Brett Cannon dfc32706a0 Make the benchmark recording more sensible for importlib.test.benchmark. 2012-02-23 19:34:35 -05:00
Victor Stinner 41a863cb81 Issue #13706: Fix format(int, "n") for locale with non-ASCII thousands separator
* Decode thousands separator and decimal point using PyUnicode_DecodeLocale()
   (from the locale encoding), instead of decoding them implicitly from latin1
 * Remove _PyUnicode_InsertThousandsGroupingLocale(), it was not used
 * Change _PyUnicode_InsertThousandsGrouping() API to return the maximum
   character if unicode is NULL
 * Replace MIN/MAX macros by Py_MIN/Py_MAX
 * stringlib/undef.h undefines STRINGLIB_IS_UNICODE
 * stringlib/localeutil.h only supports Unicode
2012-02-24 00:37:51 +01:00
Brett Cannon dcb30cf959 merge 2012-02-23 18:30:04 -05:00
Brett Cannon f500778f65 Improper type for __package__ should raise TypeError, not ValueError. 2012-02-23 18:29:12 -05:00
Brett Cannon 068915cc8b Do a type check instead of an interface check. 2012-02-23 18:18:48 -05:00
Vinay Sajip 349c900ed0 Merged upstream changes. 2012-02-23 20:53:40 +00:00
Vinay Sajip 323e4fb864 Merged fix added for recent changes in non-threading environments. 2012-02-23 20:51:18 +00:00
Vinay Sajip f05090372a Fix added for recent changes in non-threading environments. 2012-02-23 20:49:08 +00:00
Georg Brandl bada35bdf5 merge heads 2012-02-23 21:16:49 +01:00
Georg Brandl afe05bd494 Bump version to 3.2.3rc1. 2012-02-23 21:14:12 +01:00
Georg Brandl 29ca21c702 Update pydoc topics. 2012-02-23 21:12:41 +01:00
Vinay Sajip 57c223791d Merged logging flush/close changes from 3.2. 2012-02-23 20:03:49 +00:00
Vinay Sajip 0abf61db4d logging: Added locking in flush() and close() handler methods. Thanks to Fayaz Yusuf Khan for the suggestion. 2012-02-23 19:45:52 +00:00
Brett Cannon 5b761f1dca Merge 2012-02-23 10:17:56 -05:00
Nadeem Vawda 197e22c1d7 Simplify zlib bigmem tests. 2012-02-23 14:23:17 +02:00
Nadeem Vawda bc8c8175cc Fix previous fix (for test_zlib) to work on 32-bit systems. 2012-02-23 14:16:15 +02:00
Nadeem Vawda b063a48406 Issue #13873: Fix crash in test_zlib on bigmem buildbot. 2012-02-23 13:36:25 +02:00
Brett Cannon 34d8e41a47 Refactor importlib to make it easier to re-implement in C. 2012-02-22 18:33:05 -05:00
Charles-François Natali 6db1c40b37 Issue #14077: importlib: Fix regression introduced by de6703671386. 2012-02-22 21:03:09 +01:00
Ross Lagerwall e7ad419058 Fix sporadic test_subprocess regression introduced by 834650d63130. 2012-02-22 06:02:07 +02:00
Antoine Pitrou c09424255a Fix (presumably) test_hash under big-endian systems (PPC). 2012-02-22 03:33:56 +01:00
Antoine Pitrou 679be99a85 Fix (presumably) test_hash under big-endian systems (PPC). 2012-02-22 03:33:56 +01:00
Antoine Pitrou 658d1963e1 Additional debug info in case of failure 2012-02-22 02:46:58 +01:00
Antoine Pitrou 037615e1ef unload() should be sufficient 2012-02-22 02:30:09 +01:00
Antoine Pitrou abe72d7eb3 Try to debug sporadic test failures 2012-02-22 01:11:31 +01:00
Victor Stinner 65532111b4 site: don't import traceback at startup to speed up Python startup 2012-02-21 22:10:16 +01:00
Benjamin Peterson c9f54cf512 enable hash randomization by default 2012-02-21 16:08:05 -05:00
Antoine Pitrou bc499d26a8 Actually run the new tests. 2012-02-21 19:18:10 +01:00
Antoine Pitrou 07c65884c6 Add a test that memoryviews have hash randomization enabled. 2012-02-21 19:14:26 +01:00
Petri Lehtinen 8b24506534 Merge branch '3.2'
Closes #8033.
2012-02-21 13:59:40 +02:00
Petri Lehtinen 4fe85abab9 sqlite3: Fix 64-bit integer handling in user functions on 32-bit architectures
Closes #8033.
2012-02-21 13:49:50 +02:00
Ezio Melotti 307da2b070 Merge the HTMLParser fix with 3.2. 2012-02-21 09:29:10 +02:00
Ezio Melotti 29877e8e04 HTMLParser is now able to handle slashes in the start tag. 2012-02-21 09:25:00 +02:00
Benjamin Peterson 71f660e00f update to Unicode 6.1 2012-02-20 22:24:29 -05:00
Georg Brandl 802505d05e Merge more test vs hashing-order fixes from 3.2. 2012-02-21 00:34:05 +01:00
Georg Brandl 2fb477c0f0 Merge 3.2: Issue #13703 plus some related test suite fixes. 2012-02-21 00:33:36 +01:00
Georg Brandl 178e5ea305 Disable an inspect test: it depends on dict ordering which parameter is reported as duplicate. 2012-02-21 00:32:36 +01:00
Antoine Pitrou 95a97b7c0c Delete the iterator, which could accidentally keep a temporary reference to the yielded element. 2012-02-21 00:00:06 +01:00
Antoine Pitrou e9f637b062 Make "regrtest -j" "-R"-aware 2012-02-20 23:49:07 +01:00
Georg Brandl e5a0e0a75f Fix obscure failures of datetime-related tests due to the datetime tests failing to restore the system state completely after testing the pure-Python versions. 2012-02-20 23:37:36 +01:00
Georg Brandl 16684eb624 Fix dbm_gnu test relying on set order. 2012-02-20 22:48:06 +01:00
Georg Brandl f47b20f0b0 Fix use of deprecated assertRegexpMatches method. 2012-02-20 22:08:27 +01:00
Antoine Pitrou b5c793a0b3 Issue #14063: fix test_importlib failure under OS X case-insensitive filesystems
(regression)
2012-02-20 22:06:59 +01:00
Georg Brandl 61470246d0 Remove setting hash seed to regrtest's random seed and re-execv()ing: this doesn't preserve Python flags and fails from a temp directory. 2012-02-20 22:06:02 +01:00
Georg Brandl 27fe226eb1 Another test_dis dict order dependency. 2012-02-20 22:03:28 +01:00
Georg Brandl b9dafe618f Merge with 3.1. 2012-02-20 21:43:25 +01:00
Georg Brandl a108227c47 Fix test_dis dependency on dict order. 2012-02-20 21:41:03 +01:00
Georg Brandl c425a94899 Fix use of deprecated assert_ method. 2012-02-20 21:37:22 +01:00
Georg Brandl 242631da86 Fix "sys.path modified" warning in test_strlit, by not replacing sys.path itself, only its contents. 2012-02-20 21:36:28 +01:00
Georg Brandl a86b262d1e Fix bad inheritance in test_subprocess that led to a number of tests being executed twice. 2012-02-20 21:34:57 +01:00
Georg Brandl 09a7c72cad Merge from 3.1: Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated.

The environment variable PYTHONHASHSEED and the new command line flag -R control this
behavior.
2012-02-20 21:31:46 +01:00
Benjamin Peterson a3ed11bd34 don't rely on the order of module clearing 2012-02-20 15:20:37 -05:00
Benjamin Peterson 6ddac006be put docstrings on functions 2012-02-20 15:06:35 -05:00
Georg Brandl 2daf6ae249 Issue #13703: add a way to randomize the hash values of basic types (str, bytes, datetime)
in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated.

The environment variable PYTHONHASHSEED and the new command line flag -R control this
behavior.
2012-02-20 19:54:16 +01:00
Antoine Pitrou dff46faa95 Fix use of assertRaises following c760bd844222 (spotted by Alex Gaynor). 2012-02-20 19:46:26 +01:00
Antoine Pitrou ea6b4d5f70 Issue #13641: Decoding functions in the base64 module now accept ASCII-only unicode strings.
Patch by Catalin Iacob.
2012-02-20 19:30:23 +01:00
Antoine Pitrou b67075beb5 _relax_case -> _make_relax_case 2012-02-20 13:52:47 +01:00
Antoine Pitrou c541f8ef40 Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a new importlib.invalidate_caches() function.
importlib is now often faster than imp.find_module() at finding modules.
2012-02-20 01:48:16 +01:00
Brett Cannon 336b2f45e5 Fix a failing importlib test under Windows.
Closes issue #14054.
2012-02-19 19:36:44 -05:00
Benjamin Peterson 85c71ae882 fix test now that staticmethod and classmethod are bigger 2012-02-19 19:16:47 -05:00
Antoine Pitrou c135fa424e Fix last remaining build issues of _ssl under old OpenSSLs. Patch by Vinay. 2012-02-19 21:22:39 +01:00
Martin v. Löwis 7b77188e89 Create _attr/_attrNS lazily. 2012-02-19 20:55:05 +01:00
Martin v. Löwis 14aa280de2 Use __slots__ throughout instead of __dict__, to reduce the memory usage. 2012-02-19 20:25:12 +01:00
Benjamin Peterson b900d6a78c initialize __dict__ if needed 2012-02-19 10:17:30 -05:00
Benjamin Peterson 01d7eba316 allow arbitrary attributes on classmethod and staticmethod (closes #14051) 2012-02-19 01:10:25 -05:00
Jesus Cea fbc6f943e0 Test for issue #13500 2012-02-19 03:54:29 +01:00
Jesus Cea 14ed7f23c2 Test for issue #13500 2012-02-19 03:52:23 +01:00
Charles-François Natali 3ccc918b4a Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in SimpleXMLRPCServer
upon malformed POST request.
2012-02-18 15:02:10 +01:00
Charles-François Natali cd96b4f1ff Issue #14001: CVE-2012-0845: xmlrpc: Fix an endless loop in SimpleXMLRPCServer
upon malformed POST request.
2012-02-18 14:53:41 +01:00