Commit Graph

35786 Commits

Author SHA1 Message Date
Victor Stinner de993bd9b6 (Merge 3.4) asyncio, Tulip issue 205: Fix a race condition in
BaseSelectorEventLoop.sock_connect()

There is a race condition in create_connection() used with wait_for() to have a
timeout. sock_connect() registers the file descriptor of the socket to be
notified of write event (if connect() raises BlockingIOError). When
create_connection() is cancelled with a TimeoutError, sock_connect() coroutine
gets the exception, but it doesn't unregister the file descriptor for write
event. create_connection() gets the TimeoutError and closes the socket.

If you call again create_connection(), the new socket will likely gets the same
file descriptor, which is still registered in the selector. When sock_connect()
calls add_writer(), it tries to modify the entry instead of creating a new one.

This issue was originally reported in the Trollius project, but the bug comes
from Tulip in fact (Trollius is based on Tulip):
https://bitbucket.org/enovance/trollius/issue/15/after-timeouterror-on-wait_for

This change fixes the race condition. It also makes sock_connect() more
reliable (and portable) is sock.connect() raises an InterruptedError.
2014-08-31 15:08:21 +02:00
Victor Stinner d5aeccf976 asyncio, Tulip issue 205: Fix a race condition in BaseSelectorEventLoop.sock_connect()
There is a race condition in create_connection() used with wait_for() to have a
timeout. sock_connect() registers the file descriptor of the socket to be
notified of write event (if connect() raises BlockingIOError). When
create_connection() is cancelled with a TimeoutError, sock_connect() coroutine
gets the exception, but it doesn't unregister the file descriptor for write
event. create_connection() gets the TimeoutError and closes the socket.

If you call again create_connection(), the new socket will likely gets the same
file descriptor, which is still registered in the selector. When sock_connect()
calls add_writer(), it tries to modify the entry instead of creating a new one.

This issue was originally reported in the Trollius project, but the bug comes
from Tulip in fact (Trollius is based on Tulip):
https://bitbucket.org/enovance/trollius/issue/15/after-timeouterror-on-wait_for

This change fixes the race condition. It also makes sock_connect() more
reliable (and portable) is sock.connect() raises an InterruptedError.
2014-08-31 15:07:57 +02:00
R David Murray b10be15508 Merge #22215: have the smtplib 'quit' command reset the state. 2014-08-30 16:55:45 -04:00
R David Murray 0cff49fcf9 #22215: have the smtplib 'quit' command reset the state.
Without this reset, starttls would fail if a connect/starttls was done after a
quit, because smtplib assumed the existing value of emspt_features was
accurate, but it gets reset when starttls completes (and the new value does
not contain the starttls capability, since tls is already started at that
point).  (There may be additional places where this lack of reset was an
issue as well.)

Patch by Milan Oberkirch.
2014-08-30 16:51:59 -04:00
Antoine Pitrou 5ce8f35931 Issue #22098: ctypes' BigEndianStructure and LittleEndianStructure now define an empty __slots__ so that subclasses don't always get an instance dict.
Patch by Claudiu Popa.
2014-08-30 00:37:18 +02:00
Antoine Pitrou fa9211b11d Issue #22185: Fix an occasional RuntimeError in threading.Condition.wait() caused by mutation of the waiters queue without holding the lock.
Patch by Doug Zongker.
2014-08-29 23:27:33 +02:00
Antoine Pitrou a64b92edd3 Issue #22185: Fix an occasional RuntimeError in threading.Condition.wait() caused by mutation of the waiters queue without holding the lock.
Patch by Doug Zongker.
2014-08-29 23:26:36 +02:00
Berker Peksag 0dc10e0d1c Issue #22182: Use e.args to unpack exceptions correctly in distutils.file_util.move_file.
Patch by Claudiu Popa.
2014-08-29 07:09:25 +03:00
Berker Peksag 6685883c02 Issue #22182: Use e.args to unpack exceptions correctly in distutils.file_util.move_file.
Patch by Claudiu Popa.
2014-08-29 07:07:35 +03:00
Victor Stinner e6128a4a80 (Merge 3.4) asyncio, Tulip issue 201: Fix a race condition in wait_for()
Don't raise a TimeoutError if we reached the timeout and the future completed
in the same iteration of the event loop. A side effect of the bug is that
Queue.get() looses items.
2014-08-28 11:19:46 +02:00
Victor Stinner 59e0802301 asyncio, Tulip issue 201: Fix a race condition in wait_for()
Don't raise a TimeoutError if we reached the timeout and the future completed
in the same iteration of the event loop. A side effect of the bug is that
Queue.get() looses items.
2014-08-28 11:19:25 +02:00
Gregory P. Smith a232613679 The webbrowser module now uses subprocess's start_new_session=True rather
than a potentially risky preexec_fn=os.setsid call.
2014-08-27 09:41:05 -07:00
Gregory P. Smith feac3980ce The webbrowser module now uses subprocess's start_new_session=True rather
than a potentially risky preexec_fn=os.setsid call.
2014-08-27 09:34:38 -07:00
Victor Stinner 7cea44d3cf Issue #22042: Fix test_signal on Windows 2014-08-27 14:02:36 +02:00
Victor Stinner 3822760f2d Issue #22042: signal.set_wakeup_fd(fd) now raises an exception if the file
descriptor is in blocking mode.
2014-08-27 12:59:44 +02:00
Terry Jan Reedy 86cc17e69e Merge with 3.4 2014-08-27 01:58:57 -04:00
Terry Jan Reedy 2ced87f3e6 Issue #22065: Remove the now unsed configGUI menu parameter and arguments. 2014-08-27 01:58:40 -04:00
Terry Jan Reedy dfb110d8a3 Merge with 3.4 2014-08-27 01:44:13 -04:00
Terry Jan Reedy 8450c53315 Issue #22065: Menus, unlike Menubottons, do not have a state option.
Since a new demo can now be loaded while one is running,
adjust loadfile to do the same cleanup as stopIt.
2014-08-27 01:43:50 -04:00
Stefan Krah fc452518e6 Merge 3.4. 2014-08-26 21:32:26 +02:00
Stefan Krah cf26115651 Introduce and check for MPD_VERSION_HEX for precise management of builds
with an external libmpdec.
2014-08-26 21:31:47 +02:00
Stefan Krah 9ea83cff47 Merge 3.4. 2014-08-26 20:47:32 +02:00
Stefan Krah 298131a448 Issue #22090: Fix '%' formatting for infinities and NaNs. 2014-08-26 20:46:49 +02:00
Victor Stinner 54c69c2fe3 (Merge 3.4) asyncio, tulip issue 203: Add _FlowControlMixin.get_write_buffer_limits()
method
2014-08-26 00:23:23 +02:00
Victor Stinner 52bb949fd3 asyncio, tulip issue 203: Add _FlowControlMixin.get_write_buffer_limits() method 2014-08-26 00:22:28 +02:00
Victor Stinner 83b9ea4942 (Merge 3.4) asyncio: sync with Tulip
* PipeServer.close() now cancels the "accept pipe" future which cancels the
  overlapped operation.
* Fix _SelectorTransport.__repr__() if the transport was closed
* Fix debug log in BaseEventLoop.create_connection(): get the socket object
  from the transport because SSL transport closes the old socket and creates a
  new SSL socket object. Remove also the _SelectorSslTransport._rawsock
  attribute: it contained the closed socket (not very useful) and it was not
  used.
* Issue #22063: socket operations (sock_recv, sock_sendall, sock_connect,
  sock_accept) of the proactor event loop don't raise an exception in debug
  mode if the socket are in blocking mode. Overlapped operations also work on
  blocking sockets.
* Fix unit tests in debug mode: mock a non-blocking socket for socket
  operations which now raise an exception if the socket is blocking.
* _fatal_error() method of _UnixReadPipeTransport and _UnixWritePipeTransport
  now log all exceptions in debug mode
* Don't log expected errors in unit tests
* Tulip issue 200: _WaitHandleFuture._unregister_wait() now catchs and logs
  exceptions.
* Tulip issue 200: Log errors in debug mode instead of simply ignoring them.
2014-08-25 23:22:54 +02:00
Victor Stinner b261475a48 asyncio: sync with Tulip
* PipeServer.close() now cancels the "accept pipe" future which cancels the
  overlapped operation.
* Fix _SelectorTransport.__repr__() if the transport was closed
* Fix debug log in BaseEventLoop.create_connection(): get the socket object
  from the transport because SSL transport closes the old socket and creates a
  new SSL socket object. Remove also the _SelectorSslTransport._rawsock
  attribute: it contained the closed socket (not very useful) and it was not
  used.
* Issue #22063: socket operations (sock_recv, sock_sendall, sock_connect,
  sock_accept) of the proactor event loop don't raise an exception in debug
  mode if the socket are in blocking mode. Overlapped operations also work on
  blocking sockets.
* Fix unit tests in debug mode: mock a non-blocking socket for socket
  operations which now raise an exception if the socket is blocking.
* _fatal_error() method of _UnixReadPipeTransport and _UnixWritePipeTransport
  now log all exceptions in debug mode
* Don't log expected errors in unit tests
* Tulip issue 200: _WaitHandleFuture._unregister_wait() now catchs and logs
  exceptions.
* Tulip issue 200: Log errors in debug mode instead of simply ignoring them.
2014-08-25 23:20:52 +02:00
Benjamin Peterson ca18be6db2 merge 3.4 (#22265) 2014-08-24 18:08:22 -05:00
Benjamin Peterson 8e16351545 allow test to work on implementations not using ref-counting (closes #22265) 2014-08-24 18:07:28 -05:00
Benjamin Peterson d475731c54 merge 3.4 (#22267) 2014-08-24 18:04:25 -05:00
Benjamin Peterson 18bb702182 fix some test_weakref tests to not rely on ref-counting (closes #22267) 2014-08-24 18:02:15 -05:00
Antoine Pitrou cdcafb78b2 Issue #16808: inspect.stack() now returns a named tuple instead of a tuple.
Patch by Daniel Shahaf.
2014-08-24 10:50:28 -04:00
Serhiy Storchaka 1fa36268cf Issue #22034: Improve handling of wrong argument types in posixpath.join(). 2014-08-24 12:23:36 +03:00
Serhiy Storchaka 549c1972f2 Issue #22034: Got rid of misleading error message for bytearray arguments in
posixpath.join().
2014-08-24 12:18:09 +03:00
Serhiy Storchaka 66106626ed Issue #22236: Tkinter tests now don't reuse default root window. New root
window is created for every test class.

Fixed Tkinter images copying operations in NoDefaultRoot mode.

Tcl command names generated for "after" callbacks now contains a name of
original function.
2014-08-24 09:10:58 +03:00
Serhiy Storchaka d00aff2f62 Issue #22236: Tkinter tests now don't reuse default root window. New root
window is created for every test class.

Fixed Tkinter images copying operations in NoDefaultRoot mode.

Tcl command names generated for "after" callbacks now contains a name of
original function.
2014-08-24 09:07:47 +03:00
Terry Jan Reedy 133250c5b2 Merge heads. 2014-08-23 18:23:50 -04:00
Terry Jan Reedy 130f303ba5 Merge heads. 2014-08-23 18:22:43 -04:00
Antoine Pitrou ef3b9ed0ac Issue #2527: Add a *globals* argument to timeit functions, in order to override the globals namespace in which the timed code is executed.
Patch by Ben Roberts.
2014-08-22 23:13:50 -04:00
Berker Peksag 04bb443eb6 Issue #19447: Use importlib.util.cache_from_source() instead of ``bad_coding + 'c'``.
Thanks to Arfrever Frehtes Taifersar Arahesis.
2014-08-22 20:52:37 +03:00
Berker Peksag 0242f79051 Issue #19447: Use importlib.util.cache_from_source() instead of ``bad_coding + 'c'``.
Thanks to Arfrever Frehtes Taifersar Arahesis.
2014-08-22 20:52:15 +03:00
Berker Peksag 5296db908a Issue #19447: Add a test case to py_compile.compile() to make sure
it don't raise an exception if doraise is False.

Patch by Bohuslav "Slavek" Kabrda.
2014-08-22 20:18:12 +03:00
Berker Peksag 31f8a677a4 Issue #19447: Add a test case to py_compile.compile() to make sure
it don't raise an exception if doraise is False.

Patch by Bohuslav "Slavek" Kabrda.
2014-08-22 20:17:32 +03:00
Brett Cannon 145759c892 Merge for issue #22191 fix 2014-08-22 10:46:07 -04:00
Brett Cannon 14ad5319d9 Issue #22191: Fix warnings.__all__.
Thanks to Jon Poler for the patch.
2014-08-22 10:44:47 -04:00
Brett Cannon 7c08b19f86 Issue #19714: Tests for importlib.machinery.WindowsRegistryFinder.
Patch by Claudiu Popa, review by Martin v. Löwis.
2014-08-22 10:28:42 -04:00
Senthil Kumaran f499931b33 merge from 3.4
Fix issue22245 - Fix urllib2_localnet test.

Do not aggresively close wfile in the do_GET method in the BasicAuthHandler.
2014-08-22 16:27:06 +05:30
Senthil Kumaran a969ae2e11 Fix issue22245 - Fix urllib2_localnet test.
Do not aggresively close wfile in the do_GET method in the BasicAuthHandler.
2014-08-22 16:26:21 +05:30
Antoine Pitrou 55ac5b3f7b Issue #22118: Switch urllib.parse to use RFC 3986 semantics for the resolution of relative URLs, rather than RFCs 1808 and 2396.
Patch by Demian Brecht.
2014-08-21 19:16:17 -04:00
Serhiy Storchaka a7eb746278 Issue #21549: Added the "members" parameter to TarFile.list(). 2014-08-21 10:01:16 +03:00
Benjamin Peterson 48ad7c0b01 use __qualname__ to compute bound method repr (closes #21389)
Patch from Steven Barker.
2014-08-20 18:41:57 -05:00
Senthil Kumaran 2b7ccbda90 merge from 3.4
Fix Issue #8797: Raise HTTPError on failed Basic Authentication immediately. Initial patch by Sam Bull.
2014-08-20 07:55:53 +05:30
Senthil Kumaran 783737625d Fix Issue #8797: Raise HTTPError on failed Basic Authentication immediately. Initial patch by Sam Bull. 2014-08-20 07:53:58 +05:30
Terry Jan Reedy f2d9ee67e1 Merge with 3.4 2014-08-19 19:47:51 -04:00
Terry Jan Reedy 37ed873ac2 Idle ColorDelegator: finish removing code for 'as'. 2014-08-19 19:47:38 -04:00
Terry Jan Reedy f2e500c133 Merge with 3.4 2014-08-19 17:18:11 -04:00
Terry Jan Reedy c1a723a0b3 Idle ColorDelegator: remove special case code for 'as' in import statements.
'As' became a full keyword when with statements were added in 2.5/2.6.
2014-08-19 17:17:57 -04:00
Benjamin Peterson 344ff4ab2b allow recursion depth to be specified (closes #19628)
Patch from Claudiu Popa.
2014-08-19 16:13:26 -05:00
Serhiy Storchaka 54b3b3fb2c Fixed typo. 2014-08-19 18:20:48 +03:00
Serhiy Storchaka 996c3deafe Fixed typo. 2014-08-19 18:20:23 +03:00
Serhiy Storchaka ef1a79799f Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows. 2014-08-19 17:12:46 +03:00
Serhiy Storchaka 76b47655ff Issue #15696: Add a __sizeof__ implementation for mmap objects on Windows. 2014-08-19 17:11:20 +03:00
Serhiy Storchaka 79c27c3319 Clean up test_user_command. 2014-08-18 17:48:15 +03:00
Serhiy Storchaka d6ec309c36 Clean up test_user_command. 2014-08-18 17:47:29 +03:00
Benjamin Peterson c5847414f9 merge 3.4 (closes #22200) 2014-08-17 23:01:33 -05:00
Benjamin Peterson 0c56bb97ea remove 2.2 and 2.6 compat code (closes #22200)
Patch from Thomas Kluyver.
2014-08-17 23:00:42 -05:00
Serhiy Storchaka c399e85207 Issue #22165: Fixed test_undecodable_filename on Mac OS. 2014-08-17 16:58:11 +03:00
Serhiy Storchaka d9e9528818 Issue #22165: Fixed test_undecodable_filename on Mac OS. 2014-08-17 16:57:39 +03:00
Serhiy Storchaka 0879001f00 Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter. 2014-08-17 15:32:42 +03:00
Serhiy Storchaka 87bbf257ef Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter. 2014-08-17 15:31:59 +03:00
Serhiy Storchaka 95d5c9d5ff Issue #22201: Command-line interface of the zipfile module now correctly
extracts ZIP files with directory entries.  Patch by Ryan Wilson.
2014-08-17 15:17:56 +03:00
Serhiy Storchaka 97f17ff840 Issue #22201: Command-line interface of the zipfile module now correctly
extracts ZIP files with directory entries.  Patch by Ryan Wilson.
2014-08-17 15:14:48 +03:00
Serhiy Storchaka fbe912b756 Issue #22165: Fixed test_undecodable_filename on non-UTF-8 locales. 2014-08-17 12:21:06 +03:00
Serhiy Storchaka a64ce5d744 Issue #22165: Fixed test_undecodable_filename on non-UTF-8 locales. 2014-08-17 12:20:02 +03:00
Serhiy Storchaka 41a08e557a Issue #22165: SimpleHTTPRequestHandler now supports undecodable file names. 2014-08-17 08:24:49 +03:00
Serhiy Storchaka cb5bc408ad Issue #22165: SimpleHTTPRequestHandler now supports undecodable file names. 2014-08-17 08:22:11 +03:00
Nick Coghlan f9e227e5a9 Issue #20184: Add signature introspection for 30 of the builtins
Also adds a test to test_inspect to track progress on builtin
introspection support, to ensure it doesn't regress in the future.
2014-08-17 14:01:19 +10:00
Senthil Kumaran e2953e5146 merge 3.4; backout changeset 3435c5865cfc due to buildbot failures. Ref #8797 2014-08-16 22:54:24 +05:30
Senthil Kumaran 402df0975c backout changeset 3435c5865cfc due to buildbot failures. Ref #8797 2014-08-16 22:52:37 +05:30
Victor Stinner 69c1a6651d (Merge 3.4) Closes #22188: test_gdb now runs gdb with -nx: "Do not execute
commands from any .gdbinit initialization files".
2014-08-16 14:38:17 +02:00
Victor Stinner 7869a4e03a Closes #22188: test_gdb now runs gdb with -nx: "Do not execute commands from
any .gdbinit initialization files".
2014-08-16 14:38:02 +02:00
Victor Stinner cddaa1bd62 (Merge 3.4) Closes #22205: sys._debugmallocstats is a cpython specific feature,
so test_debugmallocstats should be marked as such. Patch written by Martin
Matusiak.
2014-08-16 14:11:14 +02:00
Victor Stinner 8e7966b00e Closes #22205: sys._debugmallocstats is a cpython specific feature, so
test_debugmallocstats should be marked as such. Patch written by Martin
Matusiak.
2014-08-16 14:11:01 +02:00
Senthil Kumaran 39e6c07beb merge from 3.4
Fix Issue #8797: Raise HTTPError on failed Basic Authentication immediately. Initial patch by Sam Bull.
2014-08-16 14:19:09 +05:30
Senthil Kumaran b2e3a939bf Fix Issue #8797: Raise HTTPError on failed Basic Authentication immediately. Initial patch by Sam Bull. 2014-08-16 14:17:38 +05:30
Terry Jan Reedy eae94706a3 Merge with 3.4 2014-08-15 01:23:15 -04:00
Terry Jan Reedy f819ef74da Issue #22065: Update turtledemo menu creation; don't use obsolete Menubutton. 2014-08-15 01:23:02 -04:00
Terry Jan Reedy 011b55b8d7 #22053: actually remove .txt files from 3.4. 2014-08-15 00:55:42 -04:00
Terry Jan Reedy c5212dd5d3 Issue #22065: Try the delete demohelp.txt part again. 2014-08-15 00:47:36 -04:00
Terry Jan Reedy 2d7d661f37 Issue #22065: forward port the changes in c26862955342, update docstring with
changes that were only merged into demohelp.txt, and re-delete demohelp.txt.
2014-08-15 00:39:04 -04:00
Terry Jan Reedy 94ee51ed9e Issue #10291: Backport 004fe3449193 with a few changes due to 22095.
Will forward port 22095 changes separately.
2014-08-14 23:59:32 -04:00
Terry Jan Reedy 6afc2250b3 Merge with 3.4 2014-08-14 21:55:01 -04:00
Terry Jan Reedy 0726ddf449 Issue #17390: Adjust Editor window title. Remove 'Python', move version to end. 2014-08-14 21:54:43 -04:00
Berker Peksag 3714ab4c27 Issue #21445: Pass exception messages correctly to assertTrue in
the FileCompareTestCase.test_matching test.

Patch by Steven Barker.
2014-08-14 08:35:15 +03:00
Berker Peksag 143fe05da1 Issue #21445: Pass exception messages correctly to assertTrue in
the FileCompareTestCase.test_matching test.

Patch by Steven Barker.
2014-08-14 08:34:32 +03:00
Serhiy Storchaka 1bed4a9f5f Issue #20729: Restored the use of lazy iterkeys()/itervalues()/iteritems()
in the mailbox module.  This is partial rollback of changeset f340cb045bf9.
2014-08-13 09:36:06 +03:00
Serhiy Storchaka cd3aacf525 Issue #20729: Restored the use of lazy iterkeys()/itervalues()/iteritems()
in the mailbox module.  This is partial rollback of changeset f340cb045bf9.
2014-08-13 09:35:21 +03:00
Raymond Hettinger 92c7b90148 merge 2014-08-12 12:45:28 -07:00
Raymond Hettinger 4d58897fdb Issue 22184: Early detection and reporting of missing lru_cache parameters 2014-08-12 12:44:52 -07:00
Serhiy Storchaka 574d4cfdf6 Decreased memory requirements of new tests added in issue21448. 2014-08-12 20:23:29 +03:00
Serhiy Storchaka 4d83192ea0 Decreased memory requirements of new tests added in issue21448. 2014-08-12 20:22:48 +03:00
Serhiy Storchaka 1e133cab39 Issue #21448: Fixed FeedParser feed() to avoid O(N**2) behavior when parsing long line.
Original patch by Raymond Hettinger.
2014-08-12 14:00:29 +03:00
Serhiy Storchaka 320a1c0ff7 Issue #21448: Fixed FeedParser feed() to avoid O(N**2) behavior when parsing long line.
Original patch by Raymond Hettinger.
2014-08-12 13:59:11 +03:00
Serhiy Storchaka 2a140fb58b Issue #17923: glob() patterns ending with a slash no longer match non-dirs on
AIX.  Based on patch by Delhallt.
2014-08-12 12:56:25 +03:00
Serhiy Storchaka 6f20170762 Issue #17923: glob() patterns ending with a slash no longer match non-dirs on
AIX.  Based on patch by Delhallt.
2014-08-12 12:55:12 +03:00
Antoine Pitrou bd7ff30ff9 Issue #20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier de Gaye. 2014-08-11 21:41:46 -04:00
Antoine Pitrou c04d468333 Issue #20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier de Gaye. 2014-08-11 21:40:38 -04:00
Victor Stinner 6d201685e4 Close #22175: Improve test_faulthandler readability with dedent.
Patch written by Xavier de Gaye.
2014-08-10 19:50:08 +02:00
R David Murray 2539e6744b #21725: Add RFC 6531 (SMTPUTF8) support to smtpd.
Patch by Milan Oberkirch, developed as part of his 2014 GSOC project.

Note that this also fixes a bug in mock_socket ('getpeername' was returning a
simple string instead of the tuple required for IPvX protocols), a bug in
DebugServer with respect to handling binary data (should have been fixed when
decode_data was introduced, but wasn't found until this patch was written),
and a long-standing bug in DebugServer (it was printing an extra blank line at
the end of the displayed message text).
2014-08-09 16:40:49 -04:00
Victor Stinner 68e0808ad5 (Merge 3.4) Close #22175: Improve test_faulthandler readability with dedent.
Patch written by Xavier de Gaye.
2014-08-10 19:51:05 +02:00
Serhiy Storchaka d5736faabe Issue #22161: Conformed arguments type checks in ctype to actually supported
types.  Corrected error messages about bytes arguments.
2014-08-09 09:34:25 +03:00
Serhiy Storchaka 4f06d604c4 Issue #22161: Conformed arguments type checks in ctype to actually supported
types.  Corrected error messages about bytes arguments.
2014-08-09 09:33:05 +03:00
Terry Jan Reedy f1a98f50e6 Merge with 3.4 2014-08-08 23:33:32 -04:00
Terry Jan Reedy da26cca1ce Issue #14105: Stop removing breakpoints from Idle editors.
Move BREAK tag configuration to PyShellEditorWindow.
2014-08-08 23:33:16 -04:00
Zachary Ware d630e0070f Closes #22060: Merge with 3.4 2014-08-08 13:35:11 -05:00
Zachary Ware 5a794c16d9 Issue #22060: Clean up/simplify test_ctypes, use test discovery 2014-08-08 13:32:16 -05:00
Serhiy Storchaka 304e542ccd Issue #20056: Fixed deprecation warning about bytes path in test_shutil on
Windows.  Path by Vajrasky Kok.
2014-08-07 19:39:30 +03:00
Serhiy Storchaka 41ad77c697 Issue #20056: Fixed deprecation warning about bytes path in test_shutil on
Windows.  Path by Vajrasky Kok.
2014-08-07 19:38:37 +03:00
Ezio Melotti 869778e520 #22092: merge with 3.4. 2014-08-07 03:28:26 +03:00
Ezio Melotti 1241c47aa2 #22092: use absolute imports in unittest tests. Patch by Vajrasky Kok. 2014-08-07 03:20:22 +03:00
Antoine Pitrou b349e4c929 Issue #22116: C functions and methods (of the 'builtin_function_or_method' type) can now be weakref'ed. Patch by Wei Wu. 2014-08-06 19:31:40 -04:00
Serhiy Storchaka 1121377cdb Issue #5411: Added support for the "xztar" format in the shutil module. 2014-08-06 18:50:19 +03:00
Barry Warsaw 7c549c4e64 - Issue #21539: Add a *exists_ok* argument to `Pathlib.mkdir()` to mimic
`mkdir -p` and `os.makedirs()` functionality.  When true, ignore
  FileExistsErrors.  Patch by Berker Peksag.

(With minor cleanups, additional tests, doc tweaks, etc. by Barry)

Also:

* Remove some unused imports in test_pathlib.py reported by pyflakes.
2014-08-05 11:28:12 -04:00
Ezio Melotti 0020d8e4fd #11955: merge with 3.4. 2014-08-05 02:24:28 +03:00
Ezio Melotti 12b7f48216 #11955: show the list of args in case of error in test_argparse. 2014-08-05 02:24:03 +03:00
Zachary Ware 17c336284d Closes #22104: Merge with 3.4 2014-08-04 11:18:23 -05:00
Zachary Ware 69fb6a41c5 Issue #22104: Don't hold a reference to the loaded TestSuite in runtest_inner 2014-08-04 11:15:10 -05:00
Ezio Melotti c734c387de #20977: merge with 3.4. 2014-08-04 17:17:21 +03:00
Ezio Melotti d577480197 #20977: fix undefined name in the email module. Patch by Rose Ames. 2014-08-04 17:16:49 +03:00
Raymond Hettinger bbeac6ebd8 Use two-argument form of next() and use a return-statement instead of an explicit raise StopIteration 2014-08-03 22:49:07 -07:00
Raymond Hettinger ae39fbdd84 Make the import private to keep the global namespace clean. 2014-08-03 22:40:59 -07:00
Raymond Hettinger f25a38e568 Use reversed() instead of creating a new temporary list. 2014-08-03 22:36:32 -07:00
Terry Jan Reedy 5427df266b Merge with 3.4 2014-08-03 23:03:16 -04:00
Terry Jan Reedy 4036d87f4d PEP 8 spacing in idlelib.configDialog: mostly a = b in assignments,
a, b in arg lists, and hanging indents for long arg lists.
2014-08-03 23:02:58 -04:00
Ezio Melotti 6fc16d81af #21047: set the default value for the *convert_charrefs* argument of HTMLParser to True. Patch by Berker Peksag. 2014-08-02 18:36:12 +03:00
Ezio Melotti 11bec7a1b8 Add an __all__ to html.entities. 2014-08-02 15:15:02 +03:00
Ezio Melotti 73a4359eb0 #15114: the strict mode and argument of HTMLParser, HTMLParser.error, and the HTMLParserError exception have been removed. 2014-08-02 14:10:30 +03:00
Terry Jan Reedy ffff1440d1 Issue #22077: Improve index error messages for bytearrays, bytes, lists, and
tuples by adding 'or slices'. Added ', not <typename' for bytearrays.
Original patch by Claudiu Popa.
2014-08-02 01:30:37 -04:00
Antoine Pitrou 0b87831de9 Simplify code in multiprocessing.Connection.send_bytes().
Followup to issue #20540; patch by Serhiy.
2014-07-31 18:41:57 -04:00
Antoine Pitrou cac9e719cc Issue #22111: Assorted cleanups in test_imaplib. Patch by Milan Oberkirch. 2014-07-31 18:35:45 -04:00
Serhiy Storchaka 26f9feb3b3 Back out of changes to Tkinter variables trace commands (issue #22085). 2014-07-31 07:46:08 +03:00
Terry Jan Reedy 7c87fdd5d5 Merge with 3.4 2014-07-30 19:24:47 -04:00
Terry Jan Reedy 2240533b9f Issue #22068: Don't create self reference cycles in idlelib.ConfigDialog. 2014-07-30 19:24:32 -04:00
Serhiy Storchaka 6716d60cec Issue #22085: Dropped support of Tk 8.3 in Tkinter. 2014-07-30 19:19:21 +03:00
Serhiy Storchaka f44611cadf Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows to initialize images from binary data.
2014-07-30 18:34:01 +03:00
Serhiy Storchaka 74596a887a Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows to initialize images from binary data.
2014-07-30 18:33:13 +03:00
Victor Stinner da565a790c Issue #22018: Fix test_signal: use assertEqual() not assertIs() 2014-07-30 10:03:03 +02:00
Serhiy Storchaka 8f46da1b29 Issue #21951: Temporary skip crashing test_user_command on AIX. 2014-07-30 11:00:45 +03:00
Serhiy Storchaka 95a9e0bf8c Issue #21951: Temporary skip crashing test_user_command on AIX. 2014-07-30 10:59:46 +03:00
Antoine Pitrou cc66a73d27 Issue #22003: When initialized from a bytes object, io.BytesIO() now
defers making a copy until it is mutated, improving performance and
memory use on some use cases.

Patch by David Wilson.
2014-07-29 19:41:11 -04:00
Victor Stinner 115171086a Issue #22018: On Windows, signal.set_wakeup_fd() now also supports sockets.
A side effect is that Python depends to the WinSock library.
2014-07-29 23:31:34 +02:00
Victor Stinner 66565649b5 Merge with Python 3.4 (asyncio)
- Close #22063: socket operations (socket,recv, sock_sendall, sock_connect,
  sock_accept) now raise an exception in debug mode if sockets are in blocking
  mode.
- asyncio: Use the new os.set_blocking() function of Python 3.5 if available
2014-07-29 23:09:56 +02:00
Victor Stinner 9c9f1f10d3 Close #22063: socket operations (socket,recv, sock_sendall, sock_connect,
sock_accept) now raise an exception in debug mode if sockets are in blocking
mode.
2014-07-29 23:08:17 +02:00
Victor Stinner f2ed889027 asyncio: Use the new os.set_blocking() function of Python 3.5 if available 2014-07-29 23:08:00 +02:00
Victor Stinner 1db9e7bb19 Issue #22054: Add os.get_blocking() and os.set_blocking() functions to get and
set the blocking mode of a file descriptor (False if the O_NONBLOCK flag is
set, True otherwise). These functions are not available on Windows.
2014-07-29 22:32:47 +02:00
Victor Stinner 00b39ffbd3 (Merge 3.4) asyncio: sync with Tulip
* _WaitHandleFuture.cancel() now notify IocpProactor through the overlapped
  object that the wait was cancelled.
* Optimize IocpProactor.wait_for_handle() gets the result if the wait is
  signaled immediatly.
* Enhance representation of Future and Future subclasses

  - Add "created at filename:lineno" in the representation
  - Add Future._repr_info() method which can be more easily overriden than
    Future.__repr__(). It should now be more easy to enhance Future
    representation without having to modify each subclass. For example,
    _OverlappedFuture and _WaitHandleFuture get the new "created at" information.
  - Use reprlib to format Future result, and function arguments when formatting a
    callback, to limit the length of the representation.

* Fix repr(_WaitHandleFuture)
* _WaitHandleFuture and _OverlappedFuture: hide frames of internal calls in the
  source traceback.
* Cleanup ProactorIocp._poll(): set the timeout to 0 after the first call to
  GetQueuedCompletionStatus()
* test_locks: close the temporary event loop and check the condition lock
* Remove workaround in test_futures, no more needed
2014-07-29 12:58:59 +02:00
Victor Stinner 313a980904 asyncio: sync with Tulip
* _WaitHandleFuture.cancel() now notify IocpProactor through the overlapped
  object that the wait was cancelled.
* Optimize IocpProactor.wait_for_handle() gets the result if the wait is
  signaled immediatly.
* Enhance representation of Future and Future subclasses

  - Add "created at filename:lineno" in the representation
  - Add Future._repr_info() method which can be more easily overriden than
    Future.__repr__(). It should now be more easy to enhance Future
    representation without having to modify each subclass. For example,
    _OverlappedFuture and _WaitHandleFuture get the new "created at" information.
  - Use reprlib to format Future result, and function arguments when formatting a
    callback, to limit the length of the representation.

* Fix repr(_WaitHandleFuture)
* _WaitHandleFuture and _OverlappedFuture: hide frames of internal calls in the
  source traceback.
* Cleanup ProactorIocp._poll(): set the timeout to 0 after the first call to
  GetQueuedCompletionStatus()
* test_locks: close the temporary event loop and check the condition lock
* Remove workaround in test_futures, no more needed
2014-07-29 12:58:23 +02:00
Terry Jan Reedy c95e88cd25 Merge with 3.4 2014-07-28 22:24:20 -04:00
Terry Jan Reedy 7e55db2bc5 Issue #17172: Add the ability to run turtledemo from Idle.
Make turtledemo start as active on Mac even when run with subprocess.
Patch by Ramchandra Apt, Lita Cho, and Ned Daily.
2014-07-28 22:23:59 -04:00
Victor Stinner 6b08235a03 (Merge 3.4) Issue #18174: Fix leak of file descriptor in test_tempfile 2014-07-29 01:15:22 +02:00
Victor Stinner c61c170b41 Issue #18174: Fix leak of file descriptor in test_tempfile 2014-07-29 01:13:39 +02:00
Victor Stinner 1bcab66811 (Merge 3.4) Issue #11453, #18174: Fix leak of file descriptor in test_asyncore 2014-07-29 01:01:43 +02:00
Victor Stinner 623138c163 Issue #11453, #18174: Fix leak of file descriptor in test_asyncore 2014-07-29 01:01:09 +02:00
Victor Stinner eb05576aad (Merge 3.4) Fix sporadic failure of test_pep277 on Windows: use
support.rmtree() instead of deltree().
2014-07-29 00:45:19 +02:00
Victor Stinner 0970657f01 Fix sporadic failure of test_pep277 on Windows: use support.rmtree() instead of
deltree().
2014-07-29 00:40:50 +02:00
Victor Stinner d6af04780a (Merge 3.4) Fix test_bytes when sys.stdin is None, for example on Windows when
using pythonw.exe instead of python.exe
2014-07-29 00:07:56 +02:00
Victor Stinner 7611964b2c Fix test_bytes when sys.stdin is None, for example on Windows when using
pythonw.exe instead of python.exe
2014-07-28 22:07:07 +02:00
Victor Stinner 314397aeef (Merge 3.4) asyncio, tulip issue 196: ProactorIocp._register() now registers
the overlapped in the _cache dictionary, even if we already got the result. We
need to keep a reference to the overlapped object, otherwise the memory may be
reused and GetQueuedCompletionStatus() may use random bytes and behaves badly.

There is still a hack for ConnectNamedPipe(): the overlapped object is not
register into _cache if the overlapped object completed directly.

Log also an error in debug mode in ProactorIocp._loop() if we get an unexpected
event.

Add a protection in ProactorIocp.close() to avoid blocking, even if it should
not happen. I still don't understand exactly why some the completion of some
overlapped objects are not notified.
2014-07-28 00:19:36 +02:00
Victor Stinner 42d3bdeed6 asyncio, tulip issue 196: ProactorIocp._register() now registers the overlapped
in the _cache dictionary, even if we already got the result. We need to keep a
reference to the overlapped object, otherwise the memory may be reused and
GetQueuedCompletionStatus() may use random bytes and behaves badly.

There is still a hack for ConnectNamedPipe(): the overlapped object is not
register into _cache if the overlapped object completed directly.

Log also an error in debug mode in ProactorIocp._loop() if we get an unexpected
event.

Add a protection in ProactorIocp.close() to avoid blocking, even if it should
not happen. I still don't understand exactly why some the completion of some
overlapped objects are not notified.
2014-07-28 00:18:43 +02:00
Berker Peksag 0f41acb0ea Issue #22076: Minor grammar fix.
Patch by Martin Matusiak.
2014-07-27 23:22:34 +03:00
Terry Jan Reedy 6aef4dc1bd Merge with 3.4 2014-07-27 03:01:29 -04:00
Terry Jan Reedy 8b95d5e0bf Modernize turtledemo with conditional expressions; remove duplicate line. 2014-07-27 03:01:13 -04:00
Terry Jan Reedy 4cf85694e6 Merge with 3.4 2014-07-26 19:40:31 -04:00
Terry Jan Reedy e3416e6138 Reduce unnecessary 2.7 versus 3.4+ differences in idlelib/configDialog.py.
2009-02-02 51562 (27c589f09a21) merged Mac support revisions into 3.0.
2009-03-04 52014 (dc3d24824b60) merged slightly improved version into 2.7.
Change 3.4+ to match the later 2.7 patch.  Buttons tested manually.
2014-07-26 19:40:16 -04:00
Antoine Pitrou 27a02111cf Issue #22074: Fix Lib/test/make_ssl_certs.py 2014-07-26 11:18:05 -04:00
Antoine Pitrou d2e9fdfbde Issue #22074: Fix Lib/test/make_ssl_certs.py 2014-07-26 11:15:52 -04:00
Andrew Svetlov a7121b839a Accept optional lock object in Condition ctor (tulip issue #198) 2014-07-26 17:54:56 +03:00
Andrew Svetlov f21fcd09c5 Accept optional lock object in Condition ctor (tulip issue #198) 2014-07-26 17:54:34 +03:00
Victor Stinner 011428e168 (Merge 3.4) Fix repr(_socket.socket) on Windows 64-bit: don't fail with
OverflowError on closed socket. repr(socket.socket) already works fine.
2014-07-26 14:37:57 +02:00
Victor Stinner e254e53c83 Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError
on closed socket. repr(socket.socket) already works fine.
2014-07-26 14:36:55 +02:00
Victor Stinner af529035ab (Merge 3.4) Tulip issue 196: _OverlappedFuture.set_result() now clears its
reference to the overlapped object. IocpProactor._poll() now also ignores false
alarms: GetQueuedCompletionStatus() returns the overlapped but it is still
pending.
2014-07-26 00:58:55 +02:00
Victor Stinner 51e44ea66a Tulip issue 196: _OverlappedFuture.set_result() now clears its reference to the
overlapped object. IocpProactor._poll() now also ignores false alarms:
GetQueuedCompletionStatus() returns the overlapped but it is still pending.
2014-07-26 00:58:34 +02:00
Raymond Hettinger a22d8231a3 merge 2014-07-25 15:00:30 -07:00
Raymond Hettinger 5a2146a2fd Issue #22044: Fixed premature DECREF in call_tzinfo_method. 2014-07-25 14:59:48 -07:00
Victor Stinner 19e020c5c7 (Merge 3.4) asyncio: sync with Tulip
* Tulip issue #196: IocpProactor._poll() clears the reference to the
  overlapped operation when the operation is done. It would be better to clear
  the reference in a new _OverlappedFuture.set_result() method, but it cannot
  be done yet because of a weird bug.
* BaseSelectorEventLoop._write_to_self() now logs errors in debug mode.
2014-07-25 22:40:12 +02:00
Victor Stinner 65dd69a3da asyncio: sync with Tulip
* Tulip issue #196: IocpProactor._poll() clears the reference to the
  overlapped operation when the operation is done. It would be better to clear
  the reference in a new _OverlappedFuture.set_result() method, but it cannot
  be done yet because of a weird bug.
* BaseSelectorEventLoop._write_to_self() now logs errors in debug mode.
2014-07-25 22:36:05 +02:00
Serhiy Storchaka 465e60e654 Issue #22033: Reprs of most Python implemened classes now contain actual
class name instead of hardcoded one.
2014-07-25 23:36:00 +03:00
Charles-François Natali ab9a446f23 Issue #19875: Fix random test_getsockaddrarg() failure. 2014-07-25 18:45:28 +01:00
Charles-François Natali e396c363cb Merge. 2014-07-25 18:45:02 +01:00
Charles-François Natali 65708cf510 Issue #19875: Fix random test_getsockaddrarg() failure. 2014-07-25 18:44:30 +01:00
Nick Coghlan efd5df9e52 Issue #21947: handle generator-iterator objects in dis
Patch by Clement Rouault.
2014-07-25 23:02:56 +10:00
Victor Stinner d0d64cfb59 (Merge 3.4) asyncio, test_subprocess: relax timings for slow builbots 2014-07-25 14:05:19 +02:00
Victor Stinner 2955a0bf06 asyncio, test_subprocess: relax timings for slow builbots 2014-07-25 14:05:07 +02:00
Victor Stinner d6766ae434 (Merge 3.4) asyncio: sync with Tulip
* Fix _WaitHandleFuture.cancel(): return the result of the parent cancel()
  method.
* _OverlappedFuture.cancel() now clears its reference to the overlapped object.
  Make also the _OverlappedFuture.ov attribute private.
* Check if _WaitHandleFuture completed before unregistering it in the callback.
  Add also _WaitHandleFuture._poll() and repr(_WaitHandleFuture).
* _WaitHandleFuture now unregisters its wait handler if WaitForSingleObject()
  raises an exception.
* _OverlappedFuture.set_exception() now cancels the overlapped operation.
2014-07-25 13:05:43 +02:00
Victor Stinner 18a28dc5c2 asyncio: sync with Tulip
* Fix _WaitHandleFuture.cancel(): return the result of the parent cancel()
  method.
* _OverlappedFuture.cancel() now clears its reference to the overlapped object.
  Make also the _OverlappedFuture.ov attribute private.
* Check if _WaitHandleFuture completed before unregistering it in the callback.
  Add also _WaitHandleFuture._poll() and repr(_WaitHandleFuture).
* _WaitHandleFuture now unregisters its wait handler if WaitForSingleObject()
  raises an exception.
* _OverlappedFuture.set_exception() now cancels the overlapped operation.
2014-07-25 13:05:20 +02:00
Serhiy Storchaka 68a470f65d Issue #22061: Restored empty obsolete methods removed in issue #4350 and
added deprecation warnings to them.
2014-07-25 12:29:40 +03:00
Serhiy Storchaka 1a901cc952 Issue #22061: Add deprecation warnings in empty obsolete methods. 2014-07-25 12:24:07 +03:00
Terry Jan Reedy 415c2cdedf Issue #22061: remove call of useless function slated for removal. 2014-07-25 03:08:14 -04:00
Terry Jan Reedy 5c1b8f3de6 Issue #22061: remove call of useless function slated for removal. 2014-07-25 03:06:32 -04:00
Terry Jan Reedy 99d67fe7d8 Issue #22053: Make help work, after previous patch for this issue disabled it
by removing global 'demo'. Simple fix because 2.7/3.4 fix cannot merge.
2014-07-25 02:26:40 -04:00
Terry Jan Reedy 280aace067 Issue #22053: Make help work, after previous patch for this issue disabled it
by removing global 'demo'. Refactor and remove duplicate code.
2014-07-25 01:56:24 -04:00
Victor Stinner 3953398363 (Merge 3.4) asyncio: sync with Tulip
Improve stability of the proactor event loop, especially operations on
overlapped objects:

* Tulip issue 195: Don't call UnregisterWait() twice if a _WaitHandleFuture is
  cancelled twice to fix a crash.
* IocpProactor.close(): cancel futures to cancel overlapped operations, instead
  of cancelling directly overlapped operations. Future objects may not call
  ov.cancel() if the future was cancelled or if the overlapped was already
  cancelled. The cancel() method of the future may also catch exceptions. Log
  also errors on cancellation.
* tests: rename "f" to "fut"
* Add a __repr__() method to IocpProactor
* Add a destructor to IocpProactor which closes it
* _OverlappedFuture.cancel() doesn't cancel the overlapped anymore if it is
  done: if it is already cancelled or completed. Log also an error if the
  cancellation failed.
* Add the address of the overlapped object in repr(_OverlappedFuture)
* _OverlappedFuture truncates the source traceback to hide the call to the
  parent constructor (useless in debug).
2014-07-25 00:55:23 +02:00
Victor Stinner fea6a100dc asyncio: sync with Tulip
Improve stability of the proactor event loop, especially operations on
overlapped objects:

* Tulip issue 195: Don't call UnregisterWait() twice if a _WaitHandleFuture is
  cancelled twice to fix a crash.
* IocpProactor.close(): cancel futures to cancel overlapped operations, instead
  of cancelling directly overlapped operations. Future objects may not call
  ov.cancel() if the future was cancelled or if the overlapped was already
  cancelled. The cancel() method of the future may also catch exceptions. Log
  also errors on cancellation.
* tests: rename "f" to "fut"
* Add a __repr__() method to IocpProactor
* Add a destructor to IocpProactor which closes it
* _OverlappedFuture.cancel() doesn't cancel the overlapped anymore if it is
  done: if it is already cancelled or completed. Log also an error if the
  cancellation failed.
* Add the address of the overlapped object in repr(_OverlappedFuture)
* _OverlappedFuture truncates the source traceback to hide the call to the
  parent constructor (useless in debug).
2014-07-25 00:54:53 +02:00
Victor Stinner c82a179400 Issue #22018: Fix test_set_wakeup_fd_result(), use assertEqual() not
assertIs().
2014-07-24 22:55:12 +02:00
Victor Stinner 1d8948e023 Backout 42ced0d023cd: oops, i didn't want to push this changeset :-/ 2014-07-24 22:51:05 +02:00
Victor Stinner d18ccd19f0 tets 2014-07-24 21:58:53 +02:00
Victor Stinner 316b16de13 (Merge 3.4) Issue #16133: The asynchat.async_chat.handle_read() method now
ignores BlockingIOError exceptions. Initial patch written by Xavier de Gaye.

Document also in asyncore documentation that recv() may raise BlockingIOError.
2014-07-24 19:00:28 +02:00
Victor Stinner 45cff66cf6 Issue #16133: The asynchat.async_chat.handle_read() method now ignores
BlockingIOError exceptions. Initial patch written by Xavier de Gaye.

Document also in asyncore documentation that recv() may raise BlockingIOError.
2014-07-24 18:49:36 +02:00
Victor Stinner 24ad98b98c (Merge 3.4) Issue #19884: readline: Disable the meta modifier key if stdout is
not a terminal to not write the ANSI sequence "\033[1034h" into stdout. This
sequence is used on some terminal (ex: TERM=xterm-256color") to enable support
of 8 bit characters.
2014-07-24 12:24:45 +02:00
Victor Stinner a3c80ce8b7 Issue #19884: readline: Disable the meta modifier key if stdout is not a
terminal to not write the ANSI sequence "\033[1034h" into stdout. This sequence
is used on some terminal (ex: TERM=xterm-256color") to enable support of 8 bit
characters.
2014-07-24 12:23:56 +02:00
Victor Stinner c78fd52767 test_gettext: use support.rmtree() instead of shutil.rmtree() 2014-07-24 12:08:20 +02:00
Victor Stinner cdb2c601db test_gettext: use support.rmtree() instead of shutil.rmtree() 2014-07-24 12:07:45 +02:00
Victor Stinner 216a84b043 (Merge 3.4) asyncio tests: relax timings for slow buildbots 2014-07-24 12:04:35 +02:00
Victor Stinner 0e243612f8 asyncio tests: relax timings for slow buildbots 2014-07-24 12:04:22 +02:00
Victor Stinner f0d6062e42 (Merge 3.4) Issue #20055: Fix BaseEventLoop.stop() docstring, incomplete
sentence. Patch written by Saimadhav Heblikar.
2014-07-24 11:34:26 +02:00
Victor Stinner 5006b1fd96 Issue #20055: Fix BaseEventLoop.stop() docstring, incomplete sentence.
Patch written by Saimadhav Heblikar.
2014-07-24 11:34:11 +02:00
Terry Jan Reedy c1d609e8c8 Merge with 3.4 2014-07-23 17:28:15 -04:00
Terry Jan Reedy b8352e7253 Issue #22053: Cleanup turtledemo start and stop and fix debug shutdown warning. 2014-07-23 17:27:57 -04:00
Zachary Ware baddc840d5 Merge with 3.4 2014-07-23 14:40:27 -05:00
Zachary Ware 88b2b45154 Issue #19493: Fix two uses of ctypes.test.requires (it's not a decorator)
and skip test_win32.FunctionCallTestCase.test_SEH when Python was compiled
in debug configuration or by a non-MSC compiler.
2014-07-23 14:39:50 -05:00
Serhiy Storchaka e6d9805ec4 Issue #4350: Removed a number of out-of-dated and non-working for a long time
Tkinter methods.
2014-07-23 22:33:50 +03:00
Serhiy Storchaka 4d9e903f7e Merge heads 2014-07-23 22:13:09 +03:00
Serhiy Storchaka efa9c805b1 Merge heads 2014-07-23 22:12:53 +03:00
Serhiy Storchaka 1ce2289342 Issue #6167: Backported tests for Scrollbar.activate() and Scrollbar.set()
from 6ae34a948cb4.
2014-07-23 22:08:45 +03:00
Terry Jan Reedy 22084fc8ba Merge with 3.4 2014-07-23 15:01:29 -04:00
Terry Jan Reedy b03f0422c5 Issue #21597: Turtledemo text pane can now be widened to view or copy complete
lines or narrowed for small screens.
Issie #19132: Turtledemo buttons no longer disappear when window is shrun.
Patch mostly by Lita Cho (21597) using idea from patch by Jan Kanis (18132).
2014-07-23 15:01:12 -04:00
Serhiy Storchaka 320f339131 Issue #6167: Scrollbar.activate() now returns the name of active element if
the argument is not specified.  Scrollbar.set() now always accepts only 2
arguments.  Added tests for Scrollbar.activate() and Scrollbar.set().
2014-07-23 22:00:44 +03:00
Charles-François Natali 6e20460dc6 Issue #21566: Make use of socket.listen() default backlog. 2014-07-23 19:28:13 +01:00
Serhiy Storchaka 8518b79a8d Issue #15275: Clean up and speed up the ntpath module. 2014-07-23 20:43:13 +03:00
Zachary Ware f886697659 Closes #22002: Merge with 3.4 2014-07-23 12:06:47 -05:00
Zachary Ware f012ba42fe Issue #22002: Make full use of test discovery in test sub-packages.
Adds `load_package_tests` function to test.support, uses it in test_asyncio,
test_email, test_json, test_tools, test_importlib and all test_importlib
sub-packages to implement test discovery.
2014-07-23 12:00:29 -05:00
Victor Stinner b848944d72 (Merge 3.4) asyncio: sync with Tulip
* Tulip issue 194: Don't use sys.getrefcount() in unit tests
* signal.set_wakeup_fd() can now raise an OSError on Python 3.5
2014-07-23 18:24:12 +02:00
Victor Stinner c4c464911a asyncio: sync with Tulip
* Tulip issue 194: Don't use sys.getrefcount() in unit tests
* signal.set_wakeup_fd() can now raise an OSError on Python 3.5
2014-07-23 18:21:45 +02:00
Serhiy Storchaka 37f50e0c6b Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
2014-07-23 18:50:19 +03:00
Serhiy Storchaka 8966759b03 Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
2014-07-23 18:49:31 +03:00
Charles-François Natali 9d8118e5c5 Issue #21901: Cap the maximum number of file descriptors to use for the test. 2014-07-22 21:29:52 +01:00
Charles-François Natali 889d6463b3 Issue #21901: Cap the maximum number of file descriptors to use for the test. 2014-07-22 21:25:03 +01:00
Serhiy Storchaka 521e5860a5 Issue #22032: __qualname__ instead of __name__ is now always used to format
fully qualified class names of Python implemented classes.
2014-07-22 15:00:37 +03:00
Victor Stinner c09e9752c6 (Merge 3.4) asyncio, tulip issue 193: Convert StreamWriter.drain() to a classic
coroutine

Replace also _make_drain_waiter() function with a classic _drain_helper()
coroutine.
2014-07-22 12:03:54 +02:00
Victor Stinner 31e7bfa6ba asyncio, tulip issue 193: Convert StreamWriter.drain() to a classic coroutine
Replace also _make_drain_waiter() function with a classic _drain_helper()
coroutine.
2014-07-22 12:03:40 +02:00
Serhiy Storchaka 0c937b3ed6 Issue #22031: Reprs now always use hexadecimal format with the "0x" prefix
when contain an id in form " at 0x...".
2014-07-22 12:14:52 +03:00
Serhiy Storchaka fbc877b794 Fixed bugs in reprs of CookieJar and multiprocessing.dummy.Value. 2014-07-22 11:10:37 +03:00
Serhiy Storchaka 1392df96ef Fixed bugs in reprs of CookieJar and multiprocessing.dummy.Value. 2014-07-22 11:09:36 +03:00
Senthil Kumaran 284a4a1bb0 Merge 3.4
Fix localhost checking in FileHandler. Raised in #21970.
2014-07-22 00:16:18 -07:00
Senthil Kumaran bc07ac5180 Fix localhost checking in FileHandler. Raised in #21970. 2014-07-22 00:15:20 -07:00
Antoine Pitrou 26408df88f Issue #21976: Fix test_ssl to accept LibreSSL version strings.
Thanks to William Orr.
2014-07-21 18:37:36 -04:00
Antoine Pitrou dfab935c74 Issue #21976: Fix test_ssl to accept LibreSSL version strings.
Thanks to William Orr.
2014-07-21 18:35:01 -04:00
Victor Stinner 41323e7483 (Merge 3.4) Issue #19629: Add missing "import stat"
Sort also imports in support/__init__.py
2014-07-21 21:40:55 +02:00
Victor Stinner 47ae763d28 Issue #19629: Add missing "import stat"
Sort also imports in support/__init__.py
2014-07-21 21:40:19 +02:00
Victor Stinner 963b4bab52 Merge Python 3.4
* Issue #19811, #22022: test_pathlib uses support.rmtree() instead of
  shutil.rmtree() to remove the temporary directory.

* Issue #19629: Fix support.rmtree(), use os.lstat() to check if the file is a
  directory, not os.path.isdir()
2014-07-21 19:20:06 +02:00
Victor Stinner ec86469ca3 Issue #19811, #22022: test_pathlib uses support.rmtree() instead of
shutil.rmtree() to remove the temporary directory.
2014-07-21 19:19:05 +02:00
Victor Stinner 67f8706521 Issue #19629: Fix support.rmtree(), use os.lstat() to check if the file is a
directory, not os.path.isdir()
2014-07-21 19:18:12 +02:00
Victor Stinner a7d03d98c9 Issue #22018: Hum, set_wakeup_fd() still raises ValueError on Windows 2014-07-21 17:17:28 +02:00
Victor Stinner 0bffc94d57 Issue #22018: signal.set_wakeup_fd() now raises an OSError instead of a
ValueError on fstat() failure.
2014-07-21 16:28:54 +02:00
Victor Stinner 38d773bd10 (Merge 3.4) asyncio: Fix test_stdin_broken_pipe(), drain() is not a coroutine 2014-07-21 16:23:51 +02:00
Victor Stinner 0dee8ad579 asyncio: Fix test_stdin_broken_pipe(), drain() is not a coroutine 2014-07-21 16:23:33 +02:00
Victor Stinner 56e8c29a4e Issue #22018: Add _testcapi.raise_signal()
- Use _testcapi.raise_signal() in test_signal
- close also os.pipe() file descriptors in some test_signal tests where they
  were not closed properly
- Remove faulthandler._sigill() and faulthandler._sigbus(): reuse
  _testcapi.raise_signal() in test_faulthandler
2014-07-21 12:30:22 +02:00
Raymond Hettinger 569a7fa13a merge 2014-07-20 21:31:35 -07:00
Raymond Hettinger 854e76effa Issue #21868: Prevent turtle crash due to invalid undo buffer size. 2014-07-20 21:30:32 -07:00
Victor Stinner 457b9a689b (Merge 3.4) Fix asyncio.__all__: export also unix_events and windows_events
symbols

For example, on Windows, it was not possible to get ProactorEventLoop or
DefaultEventLoopPolicy using "from asyncio import *".
2014-07-18 12:47:14 +02:00
Victor Stinner be0a2d767c Fix asyncio.__all__: export also unix_events and windows_events symbols
For example, on Windows, it was not possible to get ProactorEventLoop or
DefaultEventLoopPolicy using "from asyncio import *".
2014-07-18 12:44:25 +02:00
Victor Stinner 75dada6af3 (Merge 3.4) Issue #21247: Fix a race condition in test_send_signal() of asyncio
Add a basic synchronization mechanism to wait until the child process is ready
before sending it a signal.
2014-07-17 23:49:40 +02:00
Victor Stinner 98fa332e33 Issue #21247: Fix a race condition in test_send_signal() of asyncio
Add a basic synchronization mechanism to wait until the child process is ready
before sending it a signal.
2014-07-17 23:49:11 +02:00
Victor Stinner 2fa2c3dfc5 (Merge 3.4) Python issue #21645, Tulip issue 192: Rewrite signal handling
Since Python 3.3, the C signal handler writes the signal number into the wakeup
file descriptor and then schedules the Python call using Py_AddPendingCall().

asyncio uses the wakeup file descriptor to wake up the event loop, and relies
on Py_AddPendingCall() to schedule the final callback with call_soon().

If the C signal handler is called in a thread different than the thread of the
event loop, the loop is awaken but Py_AddPendingCall() was not called yet. In
this case, the event loop has nothing to do and go to sleep again.
Py_AddPendingCall() is called while the event loop is sleeping again and so the
final callback is not scheduled immediatly.

This patch changes how asyncio handles signals. Instead of relying on
Py_AddPendingCall() and the wakeup file descriptor, asyncio now only relies on
the wakeup file descriptor. asyncio reads signal numbers from the wakeup file
descriptor to call its signal handler.
2014-07-17 22:45:42 +02:00
Victor Stinner fe5649c7b7 Python issue #21645, Tulip issue 192: Rewrite signal handling
Since Python 3.3, the C signal handler writes the signal number into the wakeup
file descriptor and then schedules the Python call using Py_AddPendingCall().

asyncio uses the wakeup file descriptor to wake up the event loop, and relies
on Py_AddPendingCall() to schedule the final callback with call_soon().

If the C signal handler is called in a thread different than the thread of the
event loop, the loop is awaken but Py_AddPendingCall() was not called yet. In
this case, the event loop has nothing to do and go to sleep again.
Py_AddPendingCall() is called while the event loop is sleeping again and so the
final callback is not scheduled immediatly.

This patch changes how asyncio handles signals. Instead of relying on
Py_AddPendingCall() and the wakeup file descriptor, asyncio now only relies on
the wakeup file descriptor. asyncio reads signal numbers from the wakeup file
descriptor to call its signal handler.
2014-07-17 22:43:40 +02:00
Victor Stinner dc2539f957 (Merge 3.4) asyncio: Fix test_stdin_broken_pipe(), drain() can also raise
ConnectionResetError
2014-07-17 14:01:39 +02:00
Victor Stinner ddc8c8db1c asyncio: Fix test_stdin_broken_pipe(), drain() can also raise
ConnectionResetError
2014-07-17 14:01:14 +02:00
Victor Stinner edfdf54790 (Merge 3.4) asyncio, tulip issue 190: Process.communicate() now ignores
ConnectionResetError too
2014-07-17 13:12:20 +02:00
Victor Stinner d55b54d5c0 asyncio, tulip issue 190: Process.communicate() now ignores
ConnectionResetError too
2014-07-17 13:12:03 +02:00
Victor Stinner 0d35741b16 (Merge 3.4) asyncio, tulip issue 190: Process.communicate() must ignore
BrokenPipeError

If you want to handle the BrokenPipeError, you can easily reimplement
communicate().

Add also a unit test to ensure that stdin.write() + stdin.drain() raises
BrokenPipeError.
2014-07-17 12:48:33 +02:00
Victor Stinner cc996b5789 asyncio, tulip issue 190: Process.communicate() must ignore BrokenPipeError
If you want to handle the BrokenPipeError, you can easily reimplement
communicate().

Add also a unit test to ensure that stdin.write() + stdin.drain() raises
BrokenPipeError.
2014-07-17 12:25:27 +02:00
Serhiy Storchaka a98faefd68 Issue 21044: tarfile.open() now handles fileobj with an integer 'name'
attribute.  Based on patch by Martin Panter.
2014-07-17 00:00:26 +03:00
Serhiy Storchaka 2c6a3aedeb Issue 21044: tarfile.open() now handles fileobj with an integer 'name'
attribute.  Based on patch by Martin Panter.
2014-07-16 23:58:58 +03:00
Zachary Ware 3481e21e98 Issue #21918: Convert test_tools.py to a sub-package of test.
Merge with 3.4.
2014-07-16 14:31:51 -05:00
Zachary Ware 2b0a610297 Issue #21918: Convert test_tools.py to a sub-package of test. 2014-07-16 14:26:09 -05:00
Victor Stinner c3fcf4b360 (Merge 3.4) asyncio: test_as_completed(): disable "slow callback" warning 2014-07-16 18:54:25 +02:00
Victor Stinner accef5ce36 asyncio: test_as_completed(): disable "slow callback" warning 2014-07-16 18:54:13 +02:00
Victor Stinner f85581f6e5 (Merge 3.4) Issue #21163: Fix "destroy pending task" warning in test_wait_errors() 2014-07-16 18:50:54 +02:00
Victor Stinner e931f7b768 Issue #21163: Fix "destroy pending task" warning in test_wait_errors() 2014-07-16 18:50:39 +02:00
Victor Stinner 845212af41 (Merge 3.4) Issue #21163, asyncio: Ignore "destroy pending task" warnings for
private tasks in gather().
2014-07-16 18:36:58 +02:00
Victor Stinner f03b3c7564 Issue #21163, asyncio: Ignore "destroy pending task" warnings for private tasks
in gather().
2014-07-16 18:36:24 +02:00
Victor Stinner 72f8e256f6 (Merge 3.4) asyncio: test_selector_events: remove duplicate call to
_on_handshake() method

The _SelectorSslTransport constructor already calls it.
2014-07-16 18:03:26 +02:00
Victor Stinner 1314f06293 asyncio: test_selector_events: remove duplicate call to _on_handshake() method
The _SelectorSslTransport constructor already calls it.
2014-07-16 18:02:10 +02:00
Tal Einat 2e4394ee0d Issue #21765: Add support for non-ascii identifiers to HyperParser 2014-07-16 16:41:14 +03:00
Tal Einat 9b7f9e6c5a Issue #21765: Add support for non-ascii identifiers to HyperParser 2014-07-16 16:33:36 +03:00
Victor Stinner b5cace8980 Issue #21645, #21985: Remove debug code 2014-07-16 10:24:27 +02:00
Guido van Rossum e82881cea7 Fix getargspec() doctring (varkw -> keywords). 2014-07-15 12:29:11 -07:00
Terry Jan Reedy 24fb2d4012 Merge with 3.4 2014-07-14 23:07:47 -04:00
Terry Jan Reedy cfa8950aab Issue #21982: Add minimal unittest for configDialog with 46% coverage.
Fix regression that this test would have caught.
2014-07-14 23:07:32 -04:00
Victor Stinner bbbf45b08d Merge with Python 3.4 2014-07-14 22:26:57 +02:00
Victor Stinner 1cae9ec966 asyncio tests: make quiet the logs of SSL handshake failures when running tests
in debug mode
2014-07-14 22:26:34 +02:00
Victor Stinner ed589f5354 Issue #21645: test_asyncio, log debug trace into sys.__stderr__, not in
sys.stderr, to get output even if tests are run with the -j command line
option.
2014-07-14 22:04:18 +02:00
Victor Stinner 24f2a5093f Issue #21645: Add debug code to analyze a failure on FreeBSD 9 2014-07-14 21:29:23 +02:00
Victor Stinner daded80283 Merge with Python 3.4 2014-07-14 18:36:24 +02:00
Victor Stinner acdb782a83 asyncio: sync with Tulip
* Tulip issue #184: Log subprocess events in debug mode

  - Log stdin, stdout and stderr transports and protocols
  - Log process identifier (pid)
  - Log connection of pipes
  - Log process exit
  - Log Process.communicate() tasks: feed stdin, read stdout and stderr
  - Add __repr__() method to many classes related to subprocesses


* Add BaseSubprocessTransport._pid attribute. Store the pid so it is still
  accessible after the process exited. It's more convinient for debug.

* create_connection(): add the socket in the "connected to" debug log

* Clean up some docstrings and comments. Remove unused unimplemented
  _read_from_self().
2014-07-14 18:33:40 +02:00
Terry Jan Reedy e0a9a0156e Merge with 3.4 2014-07-13 17:27:41 -04:00
Terry Jan Reedy 5283c4e108 Issue #18592: Method return signature changes made to SearchDialogBase for
test purposes are now reflected in GrepDialog and ReplaceDialog.  Docstrings
are improved. Initial patch by Saimadhav Heblikar
2014-07-13 17:27:26 -04:00
Ned Deily 55966193f2 Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:20:15 -07:00
Ned Deily 5d0d2e6ed6 Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:16:56 -07:00
Ned Deily 217f4cd7ee Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:12:39 -07:00