Commit Graph

19277 Commits

Author SHA1 Message Date
Serhiy Storchaka abf68ce164 Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with
empty string or tuple argument.

On some platforms Tcl memory allocator returns NULL when allocating zero-sized
block of memory.
2014-09-11 10:57:13 +03:00
Stefan Krah b578f8a1ef Issue #19232: Speed up decimal import. Additionally, since _decimal is
self-contained, this change facilitates maintenance and the Python version
can be easily imported for experimentation.
2014-09-10 17:58:15 +02:00
Serhiy Storchaka 38684c3663 imaplib.IMAP4 now supports the context manager protocol.
Original patch by Tarek Ziadé.
2014-09-09 19:07:49 +03:00
Serhiy Storchaka 87a2803eb4 Issue #22226: Added private function _splitdict() in the Tkinter module.
First letter no longer is stripped from the "status" key in
the result of Treeview.heading().
2014-09-06 22:49:07 +03:00
Serhiy Storchaka 8f0a1d0f28 Issue #22226: Added private function _splitdict() in the Tkinter module.
First letter no longer is stripped from the "status" key in
the result of Treeview.heading().
2014-09-06 22:47:58 +03:00
Serhiy Storchaka 91453026ff Issue #19524: Fixed resource leak in the HTTP connection when an invalid
response is received.  Patch by Martin Panter.
2014-09-06 21:43:49 +03:00
Serhiy Storchaka f54c350160 Issue #19524: Fixed resource leak in the HTTP connection when an invalid
response is received.  Patch by Martin Panter.
2014-09-06 21:41:39 +03:00
Serhiy Storchaka d8a1447c99 Issue #22215: Now ValueError is raised instead of TypeError when str or bytes
argument contains not permitted null character or byte.
2014-09-06 20:07:17 +03:00
Serhiy Storchaka 0e395240cb Issue #22221: Add tests for compile() with source encoding cookie. 2014-09-05 11:01:43 +03:00
Serhiy Storchaka 607cb9cf99 Issue #22221: Add tests for compile() with source encoding cookie. 2014-09-05 11:00:56 +03:00
Antoine Pitrou 47e40429fb Issue #20421: Add a .version() method to SSL sockets exposing the actual protocol version in use. 2014-09-04 21:00:10 +02:00
Łukasz Langa 53c87d1be2 Merge fix for #19546: configparser exceptions leak implementation details 2014-09-04 01:42:29 -07:00
Łukasz Langa 949053bff2 Fix #19546: onfigparser exceptions expose implementation details. Patch by Claudiu Popa. 2014-09-04 01:36:33 -07:00
Victor Stinner ece38d9497 Issue #22334: Add debug traces to test_tcl 2014-09-04 09:53:16 +02:00
Victor Stinner b39b918baa Issue #22333: Add debug traces to test_threaded_import 2014-09-04 09:38:38 +02:00
Victor Stinner 8231d55cd4 Fix timeout in test.fork_wait 2014-09-04 01:02:17 +02:00
Victor Stinner 150b06fa19 (Merge 3.4) Issue #21440: test_zipfile: replace last direct calls to
os.remove() with support.unlink()
2014-09-04 00:51:25 +02:00
Victor Stinner 88b215e20f Issue #21440: test_zipfile: replace last direct calls to os.remove() with
support.unlink()
2014-09-04 00:51:09 +02:00
Victor Stinner 57004c696a Issue #21440: Backport changeset 4ebf97299b18 to branch 3.4, use
support.rmtree() and support.unlink() in test_zipfile & test_tarfile
2014-09-04 00:49:01 +02:00
Victor Stinner cde4517112 (Merge 3.4) Issue #20957: test_smtpnet now uses support.transient_internet() to
call check_ssl_verifiy(), so only test_connect_using_sslcontext_verified() is
skipped if smtp.gmail.com cannot be joined, not the whole file.
2014-09-04 00:36:09 +02:00
Victor Stinner 19c899c1b1 Issue #20957: test_smtpnet now uses support.transient_internet() to call
check_ssl_verifiy(), so only test_connect_using_sslcontext_verified() is
skipped if smtp.gmail.com cannot be joined, not the whole file.
2014-09-04 00:35:43 +02:00
Victor Stinner e96c83bde1 (Merge 3.4) Issue #22332: test_multiprocessing_main_handling is now skipped if
sem_open implementation is broken (ex: skipped on FreeBSD 6.4).
2014-09-03 23:48:37 +02:00
Victor Stinner 2bb8a08159 Issue #22332: test_multiprocessing_main_handling is now skipped if sem_open
implementation is broken (ex: skipped on FreeBSD 6.4).
2014-09-03 23:48:08 +02:00
Victor Stinner a6b6bba5ed (Merge 3.4) Issue #22331: Skip test_interrupted_write_text() on FreeBSD older
than 8.0
2014-09-03 23:33:43 +02:00
Victor Stinner 6ab728612d Issue #22331: Skip test_interrupted_write_text() on FreeBSD older than 8.0 2014-09-03 23:32:28 +02:00
Victor Stinner ae58649721 Issue #22043: time.monotonic() is now always available
threading.Lock.acquire(), threading.RLock.acquire() and socket operations now
use a monotonic clock, instead of the system clock, when a timeout is used.
2014-09-02 23:18:25 +02:00
Berker Peksag a42ad6bf84 Remove unused imports. 2014-09-01 12:33:12 +03:00
Berker Peksag a7614d08bf Issue #19447: Suppress output of py_compile.compile(). 2014-09-01 12:29:53 +03:00
Guido van Rossum cfd4661e78 Closes #21527: Add default number of workers to ThreadPoolExecutor. (Claudiu Popa.) 2014-09-02 10:39:18 -07:00
Berker Peksag 9425c05bab Remove unused imports. 2014-09-01 12:33:41 +03:00
Berker Peksag c85b7d3cd2 Issue #19447: Suppress output of py_compile.compile(). 2014-09-01 12:30:17 +03:00
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
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
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
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
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
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
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 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
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