Commit Graph

86529 Commits

Author SHA1 Message Date
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
Terry Jan Reedy a4cc528752 Issue #21933: Merge with 3.4 2014-09-03 16:18:34 -04:00
Terry Jan Reedy c6a1c02cce Issue #21933: Users can now change the font size for example code.
Original patch by Lita Cho.
2014-09-03 16:17:41 -04:00
Victor Stinner 5789cfbb56 Issue #22043: Fix pymonotonic(), use tv_usec=-1 as a marker to skip
the monotonic test
2014-09-03 09:43:48 +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
Victor Stinner 9bb758cee7 Issue #22043: Fix _PyTime_gettimeofday() if HAVE_GETTIMEOFDAY
Ensure also that the tv_usec field is consistent: in range [0; 999999].
2014-09-02 23:01:40 +02:00
Victor Stinner 282124b8c4 Closes #22258: Fix the the internal function set_inheritable() on Illumos.
This platform exposes the function ioctl(FIOCLEX), but calling it fails with
errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable() now falls
back to the slower fcntl() (F_GETFD and then F_SETFD).
2014-09-02 11:41:04 +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
Ned Deily 29020b155a Issue #22320: Fix broken link in the General Python FAQ.
Original patch by Josh Lynn.
2014-09-01 00:06:18 -07:00
Jason R. Coombs 311321edc1 #22315: Use advertised API for OSError 2014-08-31 17:42:20 -04:00
Jason R. Coombs d28c5f00ef #22315: Use an existent directory for 'src' to trigger appropriate behavior. 2014-08-31 17:51:22 -04:00
Jason R. Coombs 47f44c9309 #22315: Provide an actual directory during test invocation. 2014-08-31 17:37:35 -04:00
Jason R. Coombs e572ce3fb5 #22315: Use technique outlined in test_file_util 2014-08-31 17:31:32 -04:00
Jason R. Coombs 4b02e7041c #22315: Add test to capture the failure. 2014-08-31 15:02:42 -04:00
Jason R. Coombs 1be2e82c57 Correct indent 2014-08-31 15:00:47 -04:00
Jason R. Coombs b4efbe8a58 Remove unused import 2014-08-31 13:43:02 -04:00
Victor Stinner 5791a5403b pytime.h: remove duplicated "#ifndef Py_LIMITED_API" 2014-08-31 15:48:55 +02:00
Guido van Rossum cfd4661e78 Closes #21527: Add default number of workers to ThreadPoolExecutor. (Claudiu Popa.) 2014-09-02 10:39:18 -07:00
Victor Stinner 8257b6283e (Merge 3.4) Closes #22258: Fix the the internal function set_inheritable() on
Illumos.  This platform exposes the function ioctl(FIOCLEX), but calling it
fails with errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable()
now falls back to the slower fcntl() (F_GETFD and then F_SETFD).
2014-09-02 11:49:48 +02:00
Benjamin Peterson 7809569a2e sigma actually works in latex... 2014-09-01 18:26:22 -04:00
Benjamin Peterson 7df46aaf32 try to pick a unicode char that latex understands 2014-09-01 18:04:02 -04:00
Benjamin Peterson 5fb161f170 a more universal unicode char example 2014-09-01 17:59:18 -04: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
Ned Deily a847eddea9 Issue #22320: merge from 3.4 2014-09-01 00:08:00 -07:00
Jason R. Coombs 71a8eed615 Merge with 3.4; Closes #22315 2014-08-31 18:02:18 -04:00
Benjamin Peterson c49a6aa1f0 merge 3.4 2014-08-31 17:22:27 -04: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
Victor Stinner 41c13ce50a (Merge 3.4) Closes #22275: asyncio: enhance documentation of OS support 2014-08-31 14:47:56 +02:00
Victor Stinner 41f3c3f226 Closes #22275: asyncio: enhance documentation of OS support 2014-08-31 14:47:37 +02:00
Benjamin Peterson c187f15bb7 merge 3.4 (closes #22307) 2014-08-30 21:06:00 -04:00
Benjamin Peterson e218bcbf39 getuid() returns real process id not effective (closes #22307) 2014-08-30 21:04:15 -04: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
Victor Stinner 67ca33dbf4 Issue #22043: Oops, fix perf_counter() on UNIX if no monotonic clock is
available (unlikely)
2014-08-29 17:00:17 +02:00
Victor Stinner 5488449ba4 Issue #22043: Simplify time.perf_counter() on Windows
QueryPerformanceFrequency() cannot fail on Windows XP and later according to
its documentation: raise an exception on error and drop the fallback to the
system clock.
2014-08-29 16:51:33 +02:00
Victor Stinner 0011124dc2 Issue #22043: _PyTime_Init() now checks if the system clock works.
Other changes:

* The whole _PyTime API is private (not defined if Py_LIMITED_API is set)
* _PyTime_gettimeofday_info() also returns -1 on error
* Simplify PyTime_gettimeofday(): only use clock_gettime(CLOCK_REALTIME) or
  gettimeofday() on UNIX. Don't fallback to ftime() or time() anymore.
2014-08-29 16:31:59 +02:00
Victor Stinner 7efb83393c Issue #22287: On UNIX, _PyTime_gettimeofday() now uses
clock_gettime(CLOCK_REALTIME) if available. As a side effect, Python now
depends on the librt library on Solaris and on Linux (only with glibc older
than 2.17).
2014-08-29 15:41:08 +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