Commit Graph

17480 Commits

Author SHA1 Message Date
Antoine Pitrou 5df8a8a1fd Issue #19087: Improve bytearray allocation in order to allow cheap popping of data at the front (slice deletion). 2013-10-05 21:12:18 +02:00
Eric Snow 7e70fa5314 [issue 19152] Ensure we have actually registered ExtensionFileLoader as an ExecutionLoader. 2013-10-04 20:28:52 -06:00
Ezio Melotti a349478573 #19166: merge with 3.3. 2013-10-05 03:14:13 +03:00
Ezio Melotti 4e1f3d669b #19166: use an unused var in a test. Patch by Vajrasky Kok. 2013-10-05 03:07:03 +03:00
Raymond Hettinger 07573d7b24 merge 2013-10-04 16:52:39 -07:00
Raymond Hettinger cb1d96f782 Issue #18594: Make the C code more closely match the pure python code. 2013-10-04 16:51:02 -07:00
Brett Cannon 3ad327ec3a Issue #16803: Run test.test_importlib.test_abc under both
_frozen_importlib and source.
2013-10-04 14:47:14 -04:00
Antoine Pitrou 0e61ed8400 Issue #19014: memoryview.cast() is now allowed on zero-length views. 2013-10-03 19:56:54 +02:00
Antoine Pitrou 60b183407c Issue #19014: memoryview.cast() is now allowed on zero-length views. 2013-10-03 19:55:41 +02:00
Nick Coghlan fdf239a855 Close #17839: support bytes-like objects in base64 module
This mostly affected the encodebytes and decodebytes function
(which are used by base64_codec)

Also added a test to ensure all bytes-bytes codecs can handle
memoryview input and tests for handling of multidimensional
and non-bytes format input in the modern base64 API.
2013-10-03 00:43:22 +10:00
Brett Cannon 0de3f0197b Tweak skipIf message 2013-10-02 10:58:58 -04:00
Brett Cannon 634a8fc042 Try to fix issue #19134 again 2013-10-02 10:25:42 -04:00
Nick Coghlan 45163ccce4 Close #18690: register memoryview with Sequence ABC 2013-10-02 22:31:47 +10:00
Nick Coghlan a0f169cde8 Close #19078: memoryview now supports reversed
Patch by Claudiu Popa
2013-10-02 22:06:54 +10:00
Serhiy Storchaka 7c411a4041 Issue #19132: The pprint module now supports compact mode. 2013-10-02 11:56:18 +03:00
Serhiy Storchaka 092bd388ce Issue #19137: The pprint module now correctly formats instances of set and
frozenset subclasses.
2013-10-02 11:43:30 +03:00
Serhiy Storchaka 51844384f4 Issue #19137: The pprint module now correctly formats instances of set and
frozenset subclasses.
2013-10-02 11:40:49 +03:00
Nick Coghlan f05d981f58 Close #10042: functools.total_ordering now handles NotImplemented
(Patch by Katie Miller)
2013-10-02 00:02:03 +10:00
Nick Coghlan e6f4631f08 Merge #19092 from 3.3 2013-10-01 23:28:00 +10:00
Nick Coghlan 1a33b2f35b Close #19092: ExitStack now reraises exceptions from __exit__
Report and patch by Hrvoje Nikšić
2013-10-01 23:24:56 +10:00
Brett Cannon 63f03ed3db Issue #19134: Make a test in inspect conditional on multiprocessing
being available.

Thanks to Remi Pointel for the bug report.
2013-09-30 15:21:09 -04:00
Benjamin Peterson 95536b8405 rename some more tests to avoid duplicate names (#19123) 2013-09-29 15:18:43 -04:00
Antoine Pitrou 20b85557f2 Issue #19095: SSLSocket.getpeercert() now raises ValueError when the SSL handshake hasn't been done. 2013-09-29 19:50:53 +02:00
Richard Oudkerk 085ab4a553 Merge. 2013-09-29 17:33:04 +01:00
Richard Oudkerk 8b3f5aafd3 Issue #19112: avoid using function defined in method. 2013-09-29 17:29:56 +01:00
Benjamin Peterson 70157e8f02 merge 3.3 (#19112) 2013-09-29 11:11:10 -04:00
Benjamin Peterson cc6ef3620f move helper function into its test method (closes #19112) 2013-09-29 11:08:04 -04:00
Benjamin Peterson 353d450928 merge 3.3 (#19117) 2013-09-29 10:53:59 -04:00
Benjamin Peterson 52010b40f6 fix duplicate test names in test_dis (closes #19117) 2013-09-29 10:53:49 -04:00
Benjamin Peterson 42686e45c1 merge 3.3 (#19118) 2013-09-29 10:51:08 -04:00
Benjamin Peterson f8ab76039b remove duplicate test_mkd (closes #19118) 2013-09-29 10:51:00 -04:00
Benjamin Peterson 3dcdacfe6a merge 3.3 (#19116) 2013-09-29 10:50:24 -04:00
Benjamin Peterson db0601f871 combine two tests to avoid duplicate names (closes #19116) 2013-09-29 10:50:15 -04:00
Benjamin Peterson 177d89ce90 merge 3.3 (#19126) 2013-09-29 10:48:39 -04:00
Benjamin Peterson e8c8a592e7 fix duplicate test name (closes #19126) 2013-09-29 10:48:19 -04:00
Benjamin Peterson e86eb89b97 merge 3.3 (#19125) 2013-09-29 10:47:04 -04:00
Benjamin Peterson 1eca062be6 fix test to run and test that smtpd does support ELHO (closes #19125) 2013-09-29 10:46:31 -04:00
Benjamin Peterson 11f34caac4 delete duplicate test (closes #19123) 2013-09-29 10:39:51 -04:00
Benjamin Peterson 96609b701e merge 3.3 (#19122) 2013-09-29 10:02:28 -04:00
Benjamin Peterson 05ab7028ba remove duplicate test from test_import (closes #19122) 2013-09-29 10:01:40 -04:00
Nick Coghlan 4cc2afa0ec Close #18990: remove root attribute from XMLPullParser
- this was an internal implementation detail for iterparse
- this has been changed to use a new private method instead
- XMLPullParser.close docs are now more explicit about not
  returning a root element and instead direct users towards
  read_events
- also added missing docstrings and clarified some details
  related to exactly *when* events are consumed from the
  internal queue

(Initial patch by Stefan Behnel)
2013-09-28 23:50:35 +10:00
Serhiy Storchaka ab25c7c011 Issue #19053: ZipExtFile.read1() with non-zero argument no more returns empty
bytes until end of data.
2013-09-27 22:14:31 +03:00
Serhiy Storchaka d2c07a58af Issue #19053: ZipExtFile.read1() with non-zero argument no more returns empty
bytes until end of data.
2013-09-27 22:11:57 +03:00
Vinay Sajip cb2c4fe649 Updated test_logging so that errors don't occur in the absence of threading. 2013-09-27 19:08:24 +01:00
Vinay Sajip f6cdffeb78 Streamlined logging tests by moving common code to a helper function. 2013-09-27 18:41:12 +01:00
Vinay Sajip 5421f35d5e logging: added support for Unix domain sockets to SocketHandler and DatagramHandler. 2013-09-27 18:18:28 +01:00
Ethan Furman e03ea37a7b Close #19030: improvements to inspect and Enum.
inspect.getmembers and inspect.classify_class_attrs now search the metaclass
mro for types.DynamicClassAttributes (what use to be called
enum._RouteClassAttributeToGetattr); in part this means that these two
functions no longer rely solely on dir().

Besides now returning more accurate information, these improvements also
allow a more helpful help() on Enum classes.
2013-09-25 07:14:41 -07:00
Serhiy Storchaka 369606df2f Issue #19028: Fixed tkinter.Tkapp.merge() for non-string arguments. 2013-09-23 23:20:07 +03:00
Ethan Furman 64a9972b40 Close #19025: Better error message when trying to delete an Enum member.
Also slight code reorg for PEP 8 guidelines.
2013-09-22 16:18:19 -07:00
Jason R. Coombs 838521eed0 Close #18978: Merge changes. 2013-09-22 10:06:24 -04:00
Nick Coghlan f94a16b494 Close #18626: add a basic CLI for the inspect module 2013-09-22 22:46:49 +10:00
Nick Coghlan df4cb129e4 Merge from 3.3 2013-09-22 19:38:44 +10:00
Nick Coghlan ce34687d23 Fix comment in test_gdb 2013-09-22 19:38:16 +10:00
Antoine Pitrou a78cccb134 test_gdb: skip pretty-printing of sets with gdb < 7.3
(should fix the failures on OpenIndiana)
2013-09-22 00:14:27 +02:00
Antoine Pitrou d0f3e07a60 test_gdb: dump gdb version in verbose mode 2013-09-21 23:56:17 +02:00
R David Murray 4750fa8369 Merge #14984: On POSIX, enforce permissions when reading default .netrc. 2013-09-17 21:28:17 -04:00
R David Murray fb9dc0b3ae Merge #14984: On POSIX, enforce permissions when reading default .netrc. 2013-09-17 21:04:50 -04:00
R David Murray 8270a2c209 Merge #14984: On POSIX, enforce permissions when reading default .netrc. 2013-09-17 20:32:54 -04:00
R David Murray 104aab956f #14984: On POSIX, enforce permissions when reading default .netrc.
Initial patch by Bruno Piguet.

This is implemented as if a useful .netrc file could exist without passwords,
which is possible in the general case; but in fact our netrc implementation
does not support it.  Fixing that issue will be an enhancement.
2013-09-17 20:30:02 -04:00
Serhiy Storchaka 935349406a Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py script
now detect Python source code encoding only in comment lines.
2013-09-16 23:57:00 +03:00
Serhiy Storchaka dafea85190 Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py script
now detect Python source code encoding only in comment lines.
2013-09-16 23:51:56 +03:00
Ethan Furman c850f34220 Close #18693: Enum is now more help() friendly. 2013-09-15 16:59:35 -07:00
Andrew Kuchling 173a157e72 #1565525: Add traceback.clear_frames() helper function to clear locals ref'd by a traceback 2013-09-15 18:15:56 -04:00
Ethan Furman 101e0746d3 Close #18989: enum members will no longer overwrite other attributes, nor be overwritten by them. 2013-09-15 12:34:36 -07:00
Raymond Hettinger c76aa4832b merge 2013-09-14 20:52:54 -07:00
Raymond Hettinger 46f5ca31d0 Issue #19018: The heapq.merge() function no longer suppresses IndexError 2013-09-14 20:51:57 -07:00
Ethan Furman 2131a4a2fc Add __reversed__ to Enum. Minor code reorg (moved __members__ to be in alpha order). 2013-09-14 18:11:24 -07:00
Ezio Melotti 5589bd109a #18856: merge with 3.3. 2013-09-15 04:05:04 +03:00
Ezio Melotti 0a32d92bff Merge heads. 2013-09-15 03:00:42 +03:00
Antoine Pitrou 04d4d6a3aa Avoid test_logging failure when run after test_unittest, by renaming a conflicting logger 2013-09-14 21:16:39 +02:00
R David Murray f11caa0bba Merge #18206: Fix test for existence of license URL.
This test will fail because a previous attempt to fix a merge error
in site.py was incorrect, but the test wasn't running so it wasn't
caught.  The next commit will fix the site.py bug.
2013-09-14 13:31:14 -04:00
R David Murray 1bc6ceba92 #18206: Fix test for existence of license URL.
It now always checks, instead of only when the LICENSE file doesn't exist.  It
is also protected by the 'network' resource, and uses a HEAD request since we
are only doing an existence check.
2013-09-14 13:28:37 -04:00
Ezio Melotti 87f09371b0 #18856: improve test coverage of the calendar module. Patch by Madison May. 2013-09-14 04:55:53 +03:00
Charles-François Natali 0cc86850b6 Issue #16201: socket: Use inet_pton()/inet_addr() instead of ad-hoc parsing for
numeric IP addresses.
2013-09-13 19:53:08 +02:00
Eli Bendersky 12f18289c0 Merge for Issue #18997: Issue #18997: fix ElementTree crash with using pickle and __getstate__. 2013-09-13 06:27:52 -07:00
Eli Bendersky dd3661e782 Issue #18997: fix ElementTree crash with using pickle and __getstate__.
Based on report and initial patch from Germán M. Bravo
2013-09-13 06:24:25 -07:00
Eli Bendersky 7290608af7 Issue #18945: Add tests for tempfile name collision handling.
Patch by Vlad Shcherbina
2013-09-13 05:30:00 -07:00
Eli Bendersky aa04f9ae7d Issue #18945: Add tests for tempfile name collision handling.
Patch by Vlad Shcherbina
2013-09-13 05:28:20 -07:00
Serhiy Storchaka bf28d2dcad Issue #18818: The "encodingname" part of PYTHONIOENCODING is now optional. 2013-09-13 11:46:24 +03:00
Senthil Kumaran 187b063005 Fix http.server's request handling case on trailing '/'.
Patch contributed by Vajrasky Kok. Addresses Issue #17324
2013-09-13 00:22:45 -07:00
Senthil Kumaran 72c238e21a Fix http.server's request handling case on trailing '/'.
Patch contributed by Vajrasky Kok. Addresses Issue #17324
2013-09-13 00:21:18 -07:00
Senthil Kumaran 0b5463fef2 Fix typo 2013-09-09 23:13:06 -07:00
Tim Peters 72460fa68b Get "stopped" back into repr(Thread) when appropriate.
Due to recent changes, a Thread doesn't know that it's over before
someone calls .join() or .is_alive().  That meant repr(Thread)
continued to include "started" (and not "stopped") before one of
those methods was called, even if hours passed since the thread
ended.

Repaired that.
2013-09-09 18:48:24 -05:00
Tim Peters c363a23eff Issue 18984: Remove ._stopped Event from Thread internals.
The fix for issue 18808 left us checking two things to be sure a Thread
was done:  an Event (._stopped) and a mutex (._tstate_lock).  Clumsy &
brittle.  This patch removes the Event, leaving just a happy lock :-)

The bulk of the patch removes two excruciating tests, which were
verifying sanity of the internals of the ._stopped Event after a fork.
Thanks to Antoine Pitrou for verifying that's the only real value
these tests had.

One consequence of moving from an Event to a mutex:  waiters (threads
calling Thread.join()) used to block each on their own unique mutex
(internal to the ._stopped event), but now all contend on the same
mutex (._tstate_lock).  These approaches have different performance
characteristics on different platforms.  I don't think it matters in
this context.
2013-09-08 18:44:40 -05:00
Serhiy Storchaka d86709ce91 Fixed tests with Tcl/Tk <8.5 (closes #18964). 2013-09-08 20:31:20 +03:00
Serhiy Storchaka dfa689bfdd Fixed tests with Tcl/Tk <8.5 (closes #18964). 2013-09-08 20:29:37 +03:00
Jason R. Coombs 4a6524295d Issue #18978: Add tests to capture expected behavior for class-level method overrides. 2013-09-08 13:03:40 -04:00
Victor Stinner 4f7a36f84f Issue #18904: test_os and test_socket use unittest.skipIf() to check if fcntl
module is present (to record skipped tests)
2013-09-08 14:14:38 +02:00
Antoine Pitrou 5da7e7959e Issue #18808 again: fix the after-fork logic for not-yet-started or already-stopped threads.
(AFAICT, in theory, we must reset all the locks, not just those in use)
2013-09-08 13:19:06 +02:00
Charles-François Natali 6f6f4865d1 Merge. 2013-09-08 12:35:53 +02:00
Charles-François Natali 807ba8552a Issue #18963: skip test_selectors.test_above_fd_setsize on older OS X versions. 2013-09-08 12:31:32 +02:00
Charles-François Natali 833bf1fcb2 Issue #18935: Fix test_regrtest.test_timeout when built --without-threads (the
'--timeout' option requires faulthandler.dump_traceback_later).
2013-09-08 12:27:33 +02:00
Victor Stinner a3c18d0f14 Issue #18904: test_socket: add inheritance tests using fcntl and FD_CLOEXEC 2013-09-08 11:53:09 +02:00
Victor Stinner 7ba6b0f943 Issue #18904: Improve os.get/set_inheritable() tests 2013-09-08 11:47:54 +02:00
Victor Stinner 8898350076 Close #18957: The PYTHONFAULTHANDLER environment variable now only enables the
faulthandler module if the variable is non-empty. Same behaviour than other
variables like PYTHONDONTWRITEBYTECODE.
2013-09-08 11:36:23 +02:00
Charles-François Natali 9437d7a7fe Issue #18963: Fix test_selectors.test_above_fd_setsize on OS X, where the
default RLIMIT_NOFILE hard limit can be RLIMIT_INFINITY.
2013-09-08 11:34:42 +02:00
Nick Coghlan ff6382b40d Merge #18952 fix from 3.3 2013-09-08 12:49:53 +10:00
Nick Coghlan 0494c2ae7f Close #18952: correctly download test support data
When test.support was converted to a package, it started silently
skipping the tests which needed to download support data to run.

This change refactors the affected code, and also tidies up
test.support.findfile to remove the unused *here* parameter, document
the *subdir* parameter and rename the *filename* parameter to avoid
shadowing the file builtin and be consistent with the documentation.

The unexpected skips were noticed and reported by Zachary Ware
2013-09-08 11:40:34 +10:00
Antoine Pitrou 7b4769937f Issue #18808: Thread.join() now waits for the underlying thread state to be destroyed before returning.
This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
2013-09-07 23:38:37 +02:00
Senthil Kumaran 2f2ae39037 merge from 3.3
Fix License URL display and add test to check for license url presence.
Fixes issue #18206 Patch contributed by  Berker Peksag and py.user
2013-09-07 14:09:48 -07:00