]> granicus.if.org Git - python/log
python
9 years agoIssue #22351: The nntplib.NNTP constructor no longer leaves the connection
Serhiy Storchaka [Sat, 21 Mar 2015 07:41:19 +0000 (09:41 +0200)]
Issue #22351: The nntplib.NNTP constructor no longer leaves the connection
and socket open until the garbage collector cleans them up.  Patch by
Martin Panter.

9 years agoIssue #22351: The nntplib.NNTP constructor no longer leaves the connection
Serhiy Storchaka [Sat, 21 Mar 2015 07:40:26 +0000 (09:40 +0200)]
Issue #22351: The nntplib.NNTP constructor no longer leaves the connection
and socket open until the garbage collector cleans them up.  Patch by
Martin Panter.

9 years agoRemoved trailing tabs.
Serhiy Storchaka [Sat, 21 Mar 2015 07:25:53 +0000 (09:25 +0200)]
Removed trailing tabs.

9 years agoUpdate Wix version and fixes wxs file.
Steve Dower [Sat, 21 Mar 2015 05:05:33 +0000 (22:05 -0700)]
Update Wix version and fixes wxs file.

9 years agoIssue 23705: Improve the performance of __contains__ checks for deques.
Raymond Hettinger [Fri, 20 Mar 2015 23:38:56 +0000 (16:38 -0700)]
Issue 23705:  Improve the performance of __contains__ checks for deques.

9 years agoIssue #22832: Tweaked parameter names for fcntl module to better match
Serhiy Storchaka [Fri, 20 Mar 2015 18:04:21 +0000 (20:04 +0200)]
Issue #22832: Tweaked parameter names for fcntl module to better match
official POSIX documentation.  Updated the documenttion for Python 3.
Patch by Alex Shkop.

9 years agoMerge: #11726: Make linecache docs reflect that all files are treated the same.
R David Murray [Fri, 20 Mar 2015 15:32:17 +0000 (11:32 -0400)]
Merge: #11726: Make linecache docs reflect that all files are treated the same.

9 years ago#11726: Make linecache docs reflect that all files are treated the same.
R David Murray [Fri, 20 Mar 2015 15:31:38 +0000 (11:31 -0400)]
#11726: Make linecache docs reflect that all files are treated the same.

Being able to read non-python text files is not a purpose of linecache, but it
does work and people use it.  This changeset adjusts the language to make it
clear that Python files are not treated uniquely, but does not go so far as to
say reading non-python files is explicitly supported.

9 years agoIssue #22181: Run "aclocal; autoconf; autoheader" to regenerate configure
Victor Stinner [Fri, 20 Mar 2015 15:03:14 +0000 (16:03 +0100)]
Issue #22181: Run "aclocal; autoconf; autoheader" to regenerate configure

9 years agoIssue #23681: The -b option now affects comparisons of bytes with int.
Serhiy Storchaka [Fri, 20 Mar 2015 14:54:57 +0000 (16:54 +0200)]
Issue #23681: The -b option now affects comparisons of bytes with int.

9 years agoIssue #23681: Fixed Python 2 to 3 poring bugs.
Serhiy Storchaka [Fri, 20 Mar 2015 14:48:02 +0000 (16:48 +0200)]
Issue #23681: Fixed Python 2 to 3 poring bugs.
Indexing bytes retiurns an integer, not bytes.

9 years agoIssue #23681: Fixed Python 2 to 3 poring bugs.
Serhiy Storchaka [Fri, 20 Mar 2015 14:46:19 +0000 (16:46 +0200)]
Issue #23681: Fixed Python 2 to 3 poring bugs.
Indexing bytes retiurns an integer, not bytes.

9 years agoIssue #23700: NamedTemporaryFile iterator closed underlied file object in
Serhiy Storchaka [Fri, 20 Mar 2015 14:12:43 +0000 (16:12 +0200)]
Issue #23700: NamedTemporaryFile iterator closed underlied file object in
some circunstances while NamedTemporaryFile object was living.  This causes
failing test_csv.  Changed the implementation of NamedTemporaryFile.__iter__
to make tests passed.

9 years agoIssue #23700: NamedTemporaryFile iterator closed underlied file object in
Serhiy Storchaka [Fri, 20 Mar 2015 14:11:20 +0000 (16:11 +0200)]
Issue #23700: NamedTemporaryFile iterator closed underlied file object in
some circunstances while NamedTemporaryFile object was living.  This causes
failing test_csv.  Changed the implementation of NamedTemporaryFile.__iter__
to make tests passed.

9 years agoIssue #23715: Fix test_script_helper
Victor Stinner [Fri, 20 Mar 2015 13:02:33 +0000 (14:02 +0100)]
Issue #23715: Fix test_script_helper

9 years agoIssue #23696: Remove test on ZipImportError.__context__ because the context is
Victor Stinner [Fri, 20 Mar 2015 12:48:36 +0000 (13:48 +0100)]
Issue #23696: Remove test on ZipImportError.__context__ because the context is
None on Windows.

When the file is not readable, the error occurs at open on UNIX. On Windows,
the error only occurs at the first operation on the open file. It would require
to many changes to set __context__ to an OSError for all file operations, for a
little benefit (__context__ is almost never used).

9 years agoIssue #23715: Fix test_eintr, skip tests on signal.sigwaitinfo() and
Victor Stinner [Fri, 20 Mar 2015 12:42:52 +0000 (13:42 +0100)]
Issue #23715: Fix test_eintr, skip tests on signal.sigwaitinfo() and
signal.sigtimedwait() if functions are missing

9 years agoIssue #23715: Enhance test.script_helper to investigate test_eintr failure
Victor Stinner [Fri, 20 Mar 2015 12:38:08 +0000 (13:38 +0100)]
Issue #23715: Enhance test.script_helper to investigate test_eintr failure

If Python failed, show also stdout in the assertion error.

9 years agoIssue #23715: signal.sigwaitinfo() and signal.sigtimedwait() are now retried
Victor Stinner [Fri, 20 Mar 2015 11:54:28 +0000 (12:54 +0100)]
Issue #23715: signal.sigwaitinfo() and signal.sigtimedwait() are now retried
when interrupted by a signal not in the *sigset* parameter, if the signal
handler does not raise an exception. signal.sigtimedwait() recomputes the
timeout with a monotonic clock when it is retried.

Remove test_signal.test_sigwaitinfo_interrupted() because sigwaitinfo() doesn't
raise InterruptedError anymore if it is interrupted by a signal not in its
sigset parameter.

9 years agoIssue #23708: Save/restore errno in _Py_read() and _Py_write()
Victor Stinner [Fri, 20 Mar 2015 10:58:18 +0000 (11:58 +0100)]
Issue #23708: Save/restore errno in _Py_read() and _Py_write()

Save and then restore errno because PyErr_CheckSignals() and
PyErr_SetFromErrno() can modify it.

9 years agoFix compiler warnings: comparison between signed and unsigned numbers
Victor Stinner [Fri, 20 Mar 2015 10:32:24 +0000 (11:32 +0100)]
Fix compiler warnings: comparison between signed and unsigned numbers

9 years agoIssue #23708: Split assertion expression in two assertions in _Py_read() and
Victor Stinner [Fri, 20 Mar 2015 10:21:41 +0000 (11:21 +0100)]
Issue #23708: Split assertion expression in two assertions in _Py_read() and
_Py_write() to know which test failed on the buildbot "AMD64 Snow Leop 3.x".

9 years agoIssue #23696: Chain ZipImportError to the OSError
Victor Stinner [Fri, 20 Mar 2015 09:52:25 +0000 (10:52 +0100)]
Issue #23696: Chain ZipImportError to the OSError

9 years agoIssue #23709, #23001: ossaudiodev now uses Py_ssize_t for sizes instead of int
Victor Stinner [Fri, 20 Mar 2015 09:37:34 +0000 (10:37 +0100)]
Issue #23709, #23001: ossaudiodev now uses Py_ssize_t for sizes instead of int

The module is now also "SSIZE_T clean" (for PyArg_Parse...() functions) since
it switched to Py_buffer ("y*" argument format).

9 years agoIssue #23001: Fix typo
Victor Stinner [Fri, 20 Mar 2015 09:24:18 +0000 (10:24 +0100)]
Issue #23001: Fix typo

9 years agoIssue #22826: The result of open() in Tools/freeze/bkfile.py is now better
Serhiy Storchaka [Fri, 20 Mar 2015 07:21:59 +0000 (09:21 +0200)]
Issue #22826: The result of open() in Tools/freeze/bkfile.py is now better
compatible with regular files (in particular it now supports the context
management protocol).

9 years agoIssue #23001: Few functions in modules mmap, ossaudiodev, socket, ssl, and
Serhiy Storchaka [Fri, 20 Mar 2015 07:00:36 +0000 (09:00 +0200)]
Issue #23001: Few functions in modules mmap, ossaudiodev, socket, ssl, and
codecs, that accepted only read-only bytes-like object now accept writable
bytes-like object too.

9 years agoIssue #23646: Fix test_threading on Windows
Victor Stinner [Fri, 20 Mar 2015 02:06:12 +0000 (03:06 +0100)]
Issue #23646: Fix test_threading on Windows

9 years agoCleanup pytime.c: add XXX_TO_YYY constants (ex: SEC_TO_US)
Victor Stinner [Fri, 20 Mar 2015 00:55:04 +0000 (01:55 +0100)]
Cleanup pytime.c: add XXX_TO_YYY constants (ex: SEC_TO_US)

9 years agoIssue #23646: Enhance precision of time.sleep() and socket timeout when
Victor Stinner [Fri, 20 Mar 2015 00:42:20 +0000 (01:42 +0100)]
Issue #23646: Enhance precision of time.sleep() and socket timeout when
interrupted by a signal

Add a new _PyTime_AddDouble() function and remove _PyTime_ADD_SECONDS() macro.
The _PyTime_ADD_SECONDS only supported an integer number of seconds, the
_PyTime_AddDouble() has subsecond resolution.

9 years agoIssue #23709: The ossaudiodev module now retries read/write when interrupted by
Victor Stinner [Thu, 19 Mar 2015 23:27:28 +0000 (00:27 +0100)]
Issue #23709: The ossaudiodev module now retries read/write when interrupted by
a signal (PEP 475).

Use he new _Py_read() and _Py_write() functions.

9 years agoIssue #23686: Update OS X 10.5 installer build to use OpenSSL 1.0.2a.
Ned Deily [Thu, 19 Mar 2015 23:22:14 +0000 (16:22 -0700)]
Issue #23686: Update OS X 10.5 installer build to use OpenSSL 1.0.2a.

9 years agoIssue #23686: Update OS X 10.5 installer build to use OpenSSL 1.0.2a.
Ned Deily [Thu, 19 Mar 2015 23:21:10 +0000 (16:21 -0700)]
Issue #23686: Update OS X 10.5 installer build to use OpenSSL 1.0.2a.

9 years agoMerge
Antoine Pitrou [Thu, 19 Mar 2015 23:10:23 +0000 (00:10 +0100)]
Merge

9 years agoIssue #23708: Fix _Py_read() compilation error on Windows
Victor Stinner [Thu, 19 Mar 2015 22:53:04 +0000 (23:53 +0100)]
Issue #23708: Fix _Py_read() compilation error on Windows

Fix typo: self->fd => fd

9 years agoIssue #23707: On UNIX, os.urandom() now calls the Python signal handler when
Victor Stinner [Thu, 19 Mar 2015 22:36:33 +0000 (23:36 +0100)]
Issue #23707: On UNIX, os.urandom() now calls the Python signal handler when
read() is interrupted by a signal.

dev_urandom_python() now calls _Py_read() helper instead of calling directly
read().

9 years agoIssue #23708: select.devpoll now retries its internal write() when interrupted
Victor Stinner [Thu, 19 Mar 2015 22:33:09 +0000 (23:33 +0100)]
Issue #23708: select.devpoll now retries its internal write() when interrupted
by a signal (EINTR).

Modify devpoll_flush() to use _Py_write() instead of calling directly write().

9 years agoIssue #23632: Memoryviews now allow tuple indexing (including for multi-dimensional...
Antoine Pitrou [Thu, 19 Mar 2015 22:29:36 +0000 (23:29 +0100)]
Issue #23632: Memoryviews now allow tuple indexing (including for multi-dimensional memoryviews).

9 years agoIssue #22181: Fix dev_urandom_noraise(), try calling py_getrandom() before
Victor Stinner [Thu, 19 Mar 2015 22:24:45 +0000 (23:24 +0100)]
Issue #22181: Fix dev_urandom_noraise(), try calling py_getrandom() before
opening /dev/urandom.

9 years agoIssue #23708: Add _Py_read() and _Py_write() functions to factorize code handle
Victor Stinner [Thu, 19 Mar 2015 21:53:20 +0000 (22:53 +0100)]
Issue #23708: Add _Py_read() and _Py_write() functions to factorize code handle
EINTR error and special cases for Windows.

These functions now truncate the length to PY_SSIZE_T_MAX to have a portable
and reliable behaviour. For example, read() result is undefined if counter is
greater than PY_SSIZE_T_MAX on Linux.

9 years agoIssue #22181: The availability of the getrandom() is now checked in configure,
Victor Stinner [Thu, 19 Mar 2015 21:21:49 +0000 (22:21 +0100)]
Issue #22181: The availability of the getrandom() is now checked in configure,
and stored in pyconfig.h as the new HAVE_GETRANDOM_SYSCALL define.

Fix os.urandom() tests using file descriptors if os.urandom() uses getrandom().

9 years agoIssue #23646: If time.sleep() is interrupted by a signal, the sleep is now
Victor Stinner [Thu, 19 Mar 2015 20:54:09 +0000 (21:54 +0100)]
Issue #23646: If time.sleep() is interrupted by a signal, the sleep is now
retried with the recomputed delay, except if the signal handler raises an
exception (PEP 475).

Modify also test_signal to use a monotonic clock instead of the system clock.

9 years agoFixed Misc/NEWS entry for issue #23136.
Serhiy Storchaka [Thu, 19 Mar 2015 17:54:51 +0000 (19:54 +0200)]
Fixed Misc/NEWS entry for issue #23136.

9 years agoFixed Misc/NEWS entry for issue #23136.
Serhiy Storchaka [Thu, 19 Mar 2015 17:52:50 +0000 (19:52 +0200)]
Fixed Misc/NEWS entry for issue #23136.

9 years agoIssue #23136: _strptime now uniformly handles all days in week 0, including
Serhiy Storchaka [Thu, 19 Mar 2015 17:14:15 +0000 (19:14 +0200)]
Issue #23136: _strptime now uniformly handles all days in week 0, including
Jan 30 of previous year.  Based on patch by Jim Carroll.

9 years agoIssue #23136: _strptime now uniformly handles all days in week 0, including
Serhiy Storchaka [Thu, 19 Mar 2015 17:13:37 +0000 (19:13 +0200)]
Issue #23136: _strptime now uniformly handles all days in week 0, including
Jan 30 of previous year.  Based on patch by Jim Carroll.

9 years agoIssue #23700: Iterator of NamedTemporaryFile now keeps a reference to
Serhiy Storchaka [Thu, 19 Mar 2015 13:24:27 +0000 (15:24 +0200)]
Issue #23700: Iterator of NamedTemporaryFile now keeps a reference to
NamedTemporaryFile instance.  Patch by Bohuslav Kabrda.

9 years agoIssue #23700: Iterator of NamedTemporaryFile now keeps a reference to
Serhiy Storchaka [Thu, 19 Mar 2015 13:23:15 +0000 (15:23 +0200)]
Issue #23700: Iterator of NamedTemporaryFile now keeps a reference to
NamedTemporaryFile instance.  Patch by Bohuslav Kabrda.

9 years agomerge 3.4
Benjamin Peterson [Thu, 19 Mar 2015 02:36:23 +0000 (21:36 -0500)]
merge 3.4

9 years agowrap properly
Benjamin Peterson [Thu, 19 Mar 2015 02:35:38 +0000 (21:35 -0500)]
wrap properly

9 years agonull merge from 3.4
Ethan Furman [Thu, 19 Mar 2015 01:26:08 +0000 (18:26 -0700)]
null merge from 3.4

9 years agoissue23673
Ethan Furman [Thu, 19 Mar 2015 01:19:30 +0000 (18:19 -0700)]
issue23673
add private method to enum to support replacing global constants with Enum members:
- search for candidate constants via supplied filter
- create new enum class and members
- insert enum class and replace constants with members via supplied module name
- replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle
modify IntEnum classes to use new method

9 years agoissue23673
Ethan Furman [Thu, 19 Mar 2015 00:27:57 +0000 (17:27 -0700)]
issue23673
add private method to enum to support replacing global constants with Enum members:
- search for candidate constants via supplied filter
- create new enum class and members
- insert enum class and replace constants with members via supplied module name
- replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle
modify IntEnum classes to use new method

9 years agoIssue #22903: The fake test case created by unittest.loader when it fails importing...
Antoine Pitrou [Wed, 18 Mar 2015 23:01:37 +0000 (00:01 +0100)]
Issue #22903: The fake test case created by unittest.loader when it fails importing a test module is now picklable.

9 years agoIssue #22903: The fake test case created by unittest.loader when it fails importing...
Antoine Pitrou [Wed, 18 Mar 2015 22:56:46 +0000 (23:56 +0100)]
Issue #22903: The fake test case created by unittest.loader when it fails importing a test module is now picklable.

9 years agoIssue #23353: improve exceptions tests for generators
Antoine Pitrou [Wed, 18 Mar 2015 21:23:40 +0000 (22:23 +0100)]
Issue #23353: improve exceptions tests for generators

9 years agoIssue #23353: improve exceptions tests for generators
Antoine Pitrou [Wed, 18 Mar 2015 21:22:46 +0000 (22:22 +0100)]
Issue #23353: improve exceptions tests for generators

9 years agoRemoved unintentional trailing spaces in non-external and non-generated C files.
Serhiy Storchaka [Wed, 18 Mar 2015 19:53:15 +0000 (21:53 +0200)]
Removed unintentional trailing spaces in non-external and non-generated C files.

9 years agoRestored backward compatibility of pickling http.cookies.Morsel. It was
Serhiy Storchaka [Wed, 18 Mar 2015 16:03:40 +0000 (18:03 +0200)]
Restored backward compatibility of pickling http.cookies.Morsel.  It was
broken after converting instance attributes to properies in issue #2211.

9 years agoMerge 3.4 (tracemalloc typo)
Victor Stinner [Wed, 18 Mar 2015 15:05:32 +0000 (16:05 +0100)]
Merge 3.4 (tracemalloc typo)

9 years ago_tracemalloc.c: Fix typo
Victor Stinner [Wed, 18 Mar 2015 15:05:18 +0000 (16:05 +0100)]
_tracemalloc.c: Fix typo

9 years agoFix compiler warning in mmapmodule.c (compare signed/unsigned integers)
Victor Stinner [Wed, 18 Mar 2015 14:04:34 +0000 (15:04 +0100)]
Fix compiler warning in mmapmodule.c (compare signed/unsigned integers)

9 years agoInitialize variables to prevent GCC warnings
Victor Stinner [Wed, 18 Mar 2015 14:02:06 +0000 (15:02 +0100)]
Initialize variables to prevent GCC warnings

9 years agoFix compiler warning in dtoa.c
Victor Stinner [Wed, 18 Mar 2015 14:01:44 +0000 (15:01 +0100)]
Fix compiler warning in dtoa.c

9 years agoIssue #22181: On Linux, os.urandom() now uses the new getrandom() syscall if
Victor Stinner [Wed, 18 Mar 2015 13:39:33 +0000 (14:39 +0100)]
Issue #22181: On Linux, os.urandom() now uses the new getrandom() syscall if
available, syscall introduced in the Linux kernel 3.17. It is more reliable
and more secure, because it avoids the need of a file descriptor and waits
until the kernel has enough entropy.

9 years agoMerge 3.4 (linecache doc)
Victor Stinner [Wed, 18 Mar 2015 13:19:19 +0000 (14:19 +0100)]
Merge 3.4 (linecache doc)

9 years agoIssue #11726: Fix linecache example in the doc
Victor Stinner [Wed, 18 Mar 2015 13:16:50 +0000 (14:16 +0100)]
Issue #11726: Fix linecache example in the doc

Use a Python source file (linecache.__file__) instead of /etc/passwd.

Modify also linecache docstrings to clarify the linecache is written to cache
Python source files, not any text files.

9 years agoMerge 3.4 (linecache doc)
Victor Stinner [Wed, 18 Mar 2015 13:14:52 +0000 (14:14 +0100)]
Merge 3.4 (linecache doc)

9 years agoIssue #11726: clarify linecache doc: linecache is written to cache Python
Victor Stinner [Wed, 18 Mar 2015 13:14:42 +0000 (14:14 +0100)]
Issue #11726: clarify linecache doc: linecache is written to cache Python
source files, even if "it works" with other text files encoded to UTF-8.

9 years agoIssue #12155: Fix queue doc example to join threads
Victor Stinner [Wed, 18 Mar 2015 13:05:43 +0000 (14:05 +0100)]
Issue #12155: Fix queue doc example to join threads

Use None as a sentinel to stop a worker.

9 years agoMerge 3.4 (marshal doc)
Victor Stinner [Wed, 18 Mar 2015 12:59:02 +0000 (13:59 +0100)]
Merge 3.4 (marshal doc)

9 years agoIssue #19428: Document that PyMarshal_ReadLongFromFile() and
Victor Stinner [Wed, 18 Mar 2015 12:58:49 +0000 (13:58 +0100)]
Issue #19428: Document that PyMarshal_ReadLongFromFile() and
PyMarshal_ReadShortFromFile() can fail.

9 years agoIssue #19428: Handle PyMarshal_Read*() errors in run_pyc_file()
Victor Stinner [Wed, 18 Mar 2015 12:56:25 +0000 (13:56 +0100)]
Issue #19428: Handle PyMarshal_Read*() errors in run_pyc_file()

Detect also earlier PyMarshal_Read*() errors in zipimport.

9 years agoMerge 3.4 (asyncio)
Victor Stinner [Wed, 18 Mar 2015 10:37:54 +0000 (11:37 +0100)]
Merge 3.4 (asyncio)

9 years agoIssue #23456: Add missing @coroutine decorators in asyncio
Victor Stinner [Wed, 18 Mar 2015 10:37:42 +0000 (11:37 +0100)]
Issue #23456: Add missing @coroutine decorators in asyncio

9 years agoIssue #23605: Fix os.walk(topdown=True), don't cache entry.is_symlink() because
Victor Stinner [Wed, 18 Mar 2015 10:29:47 +0000 (11:29 +0100)]
Issue #23605: Fix os.walk(topdown=True), don't cache entry.is_symlink() because
the caller can replace the directory with a different file kind.

The bottom-up way, os.walk(topdown=False), still uses entry.is_symlink(), and
so can be faster than Python 3.4.

9 years agoIssue #23694: Handle EINTR in _Py_open() and _Py_fopen_obj()
Victor Stinner [Wed, 18 Mar 2015 08:52:54 +0000 (09:52 +0100)]
Issue #23694: Handle EINTR in _Py_open() and _Py_fopen_obj()

Retry open()/fopen() if it fails with EINTR and the Python signal handler
doesn't raise an exception.

9 years agoIssue #2211: Updated the implementation of the http.cookies.Morsel class.
Serhiy Storchaka [Wed, 18 Mar 2015 08:59:57 +0000 (10:59 +0200)]
Issue #2211: Updated the implementation of the http.cookies.Morsel class.
Setting attributes key, value and coded_value directly now is deprecated.
update() and setdefault() now transform and check keys.  Comparing for
equality now takes into account attributes key, value and coded_value.
copy() now returns a Morsel, not a dict.  repr() now contains all attributes.
Optimized checking keys and quoting values.  Added new tests.
Original patch by Demian Brecht.

9 years agoIssue #23207: merged fix from 3.4.
Vinay Sajip [Wed, 18 Mar 2015 08:49:57 +0000 (08:49 +0000)]
Issue #23207: merged fix from 3.4.

9 years agoIssue #23207: Improved kwarg validation.
Vinay Sajip [Wed, 18 Mar 2015 08:47:58 +0000 (08:47 +0000)]
Issue #23207: Improved kwarg validation.

9 years agoIssue #23694: Enhance _Py_fopen(), it now raises an exception on error
Victor Stinner [Wed, 18 Mar 2015 00:39:23 +0000 (01:39 +0100)]
Issue #23694: Enhance _Py_fopen(), it now raises an exception on error

* If fopen() fails, OSError is raised with the original filename object.
* The GIL is now released while calling fopen()

9 years agoIssue #23694: Enhance _Py_open(), it now raises exceptions
Victor Stinner [Tue, 17 Mar 2015 23:22:14 +0000 (00:22 +0100)]
Issue #23694: Enhance _Py_open(), it now raises exceptions

* _Py_open() now raises exceptions on error. If open() fails, it raises an
  OSError with the filename.
* _Py_open() now releases the GIL while calling open()
* Add _Py_open_noraise() when _Py_open() cannot be used because the GIL is not
  held

9 years agoIssue #23644: Fix issues with C++ when compiling Python extensions
Victor Stinner [Tue, 17 Mar 2015 21:53:27 +0000 (22:53 +0100)]
Issue #23644: Fix issues with C++ when compiling Python extensions

Disable completly pyatomic.h on C++, because <stdatomic.h> is not compatible with C++.

<pyatomic.h> is only needed by the optimized PyThreadState_GET() macro in
pystate.h. Instead, declare PyThreadState_GET() as an alias to
PyThreadState_Get(), as done for limited API.

9 years agoFix patch attribution for issue 18983.
Robert Collins [Tue, 17 Mar 2015 20:59:33 +0000 (09:59 +1300)]
Fix patch attribution for issue 18983.

9 years agoIssue #18983: Allow selection of output units in timeit.
Robert Collins [Tue, 17 Mar 2015 20:54:50 +0000 (09:54 +1300)]
Issue #18983: Allow selection of output units in timeit.

This allows manual selection of a specific unit such as usecs rather than the
use of a heuristic. This is intended to aid machine processing of timeit
output.

Patch by Serhiy Storchaka.

9 years agoIssue #23685: Fix usage of PyMODINIT_FUNC in _json, _scproxy, nis, pyexpat
Victor Stinner [Tue, 17 Mar 2015 16:48:27 +0000 (17:48 +0100)]
Issue #23685: Fix usage of PyMODINIT_FUNC in _json, _scproxy, nis, pyexpat
_codecs_cn, _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr and _codecs_tw
modules.

pyexpat.c doesn't need to redeclare PyMODINIT_FUNC, it's already declared in
Include/pyport.h.

9 years agoIssue #22585: null merge
Ned Deily [Tue, 17 Mar 2015 11:32:30 +0000 (04:32 -0700)]
Issue #22585: null merge

9 years agoIssue #22585: make URandomFDTests test case actually run
Ned Deily [Tue, 17 Mar 2015 11:30:08 +0000 (04:30 -0700)]
Issue #22585: make URandomFDTests test case actually run

9 years agoRevert changeset d927047b1d8eb87738676980a24930d053ba2150
Victor Stinner [Tue, 17 Mar 2015 09:49:17 +0000 (10:49 +0100)]
Revert changeset d927047b1d8eb87738676980a24930d053ba2150

Sorry, it was a mistake, the patch is still under review: issue #23646.

9 years agoIssue #23682: Delete Python 2.2 mention from distutils documentation.
Berker Peksag [Tue, 17 Mar 2015 04:56:11 +0000 (06:56 +0200)]
Issue #23682: Delete Python 2.2 mention from distutils documentation.

Patch by Thomas Kluyver.

9 years agoIssue #23682: Delete Python 2.2 mention from distutils documentation.
Berker Peksag [Tue, 17 Mar 2015 04:55:48 +0000 (06:55 +0200)]
Issue #23682: Delete Python 2.2 mention from distutils documentation.

Patch by Thomas Kluyver.

9 years agomerge 3.4 (#23679)
Benjamin Peterson [Mon, 16 Mar 2015 17:45:27 +0000 (12:45 -0500)]
merge 3.4 (#23679)

9 years agoversionchanged for rc4 removal (closes #23679)
Benjamin Peterson [Mon, 16 Mar 2015 17:43:38 +0000 (12:43 -0500)]
versionchanged for rc4 removal (closes #23679)

9 years agoIssue #23680: Reduce risk of race condition in check_interrupted_write() of
Victor Stinner [Mon, 16 Mar 2015 17:03:06 +0000 (18:03 +0100)]
Issue #23680: Reduce risk of race condition in check_interrupted_write() of
test_io. Allocate the large data before scheduling an alarm in 1 second.

On very slow computer, the alarm rings sometimes during the memory allocation.

9 years agoIssue #23680: Reduce risk of race condition in check_interrupted_write_retry()
Victor Stinner [Mon, 16 Mar 2015 16:57:49 +0000 (17:57 +0100)]
Issue #23680: Reduce risk of race condition in check_interrupted_write_retry()
of test_io. Allocate the large data before scheduling an alarm in 1 second.

On very slow computer, the alarm rings sometimes during the memory allocation.

9 years agoIssue #23571: Restore removed assert(!PyErr_Occurred()); in
Victor Stinner [Mon, 16 Mar 2015 10:52:32 +0000 (11:52 +0100)]
Issue #23571: Restore removed assert(!PyErr_Occurred()); in
PyEval_CallObjectWithKeywords()

Sorry Serhiy, I missed your explanation because the review email was moved to
my Spam folder :-(

9 years agoUse non-zero and non-last positions in error handler tests.
Serhiy Storchaka [Mon, 16 Mar 2015 06:31:38 +0000 (08:31 +0200)]
Use non-zero and non-last positions in error handler tests.

9 years agoUse non-zero and non-last positions in error handler tests.
Serhiy Storchaka [Mon, 16 Mar 2015 06:29:47 +0000 (08:29 +0200)]
Use non-zero and non-last positions in error handler tests.

9 years agoIssue #23585: make patchcheck will ensure the interpreter is built.
Robert Collins [Mon, 16 Mar 2015 02:30:31 +0000 (15:30 +1300)]
Issue #23585: make patchcheck will ensure the interpreter is built.

9 years agoIssue #23631: Fix traceback.format_list when a traceback has been mutated.
Robert Collins [Mon, 16 Mar 2015 02:27:16 +0000 (15:27 +1300)]
Issue #23631: Fix traceback.format_list when a traceback has been mutated.