Commit Graph

8597 Commits

Author SHA1 Message Date
Serhiy Storchaka 8be6be427d Issue #21802: The reader in BufferedRWPair now is closed even when closing
writer failed in BufferedRWPair.close().
2015-03-24 23:23:28 +02:00
Serhiy Storchaka 7665be6087 Issue #21802: The reader in BufferedRWPair now is closed even when closing
writer failed in BufferedRWPair.close().
2015-03-24 23:21:57 +02:00
Victor Stinner 91afbb6088 Issue #23753: Move _Py_wstat() from Python/fileutils.c to Modules/getpath.c
I expected more users of _Py_wstat(), but in practice it's only used by
Modules/getpath.c. Move the function because it's not needed on Windows.
Windows uses PC/getpathp.c which uses the Win32 API (ex: GetFileAttributesW())
not the POSIX API.
2015-03-24 12:16:28 +01:00
Victor Stinner f329878e74 Issue #23753: Python doesn't support anymore platforms without stat() or
fstat(), these functions are always required.

Remove HAVE_STAT and HAVE_FSTAT defines, and stop supporting DONT_HAVE_STAT and
DONT_HAVE_FSTAT.
2015-03-24 10:27:50 +01:00
Raymond Hettinger 551350a79f Improve and fix-up comments. 2015-03-24 00:19:53 -07:00
Raymond Hettinger 0f1451c8c0 Issue 23744: Minor speed-up for deque.__bool__(). 2015-03-23 23:23:55 -07:00
Victor Stinner d1f3a002c3 Merge 3.4 (faulthandler ICC) 2015-03-23 21:21:00 +01:00
Victor Stinner 19276f184f Issue #23654: Fix faulthandler._stack_overflow() for the Intel C Compiler (ICC)
Issue #23654: Turn off ICC's tail call optimization for the stack_overflow
generator. ICC turns the recursive tail call into a loop.

Patch written by Matt Frank.
2015-03-23 21:20:27 +01:00
Serhiy Storchaka f07a4b663d Issue #21526: Tkinter now supports new boolean type in Tcl 8.5. 2015-03-23 00:47:45 +02:00
Victor Stinner efde146b0c Issue #23571: _Py_CheckFunctionResult() now gives the name of the function
which returned an invalid result (result+error or no result without error) in
the exception message.

Add also unit test to check that the exception contains the name of the
function.

Special case: the final _PyEval_EvalFrameEx() check doesn't mention the
function since it didn't execute a single function but a whole frame.
2015-03-21 15:04:43 +01:00
Raymond Hettinger 6921c13bbb Minor nit. Make the rotate() success/fail tests consistent. 2015-03-21 02:03:40 -07:00
Raymond Hettinger ac13ad6a32 For safety, wait to decref deleted values until the deque state has been restored. 2015-03-21 01:53:16 -07:00
Raymond Hettinger 0f6f94778a Fix minor formatting nits and remove unnecessary comment. 2015-03-21 01:42:10 -07:00
Raymond Hettinger 32ea16577d Issue 23704: Add index(), copy(), and insert() to deques. Register deques as a MutableSequence. 2015-03-21 01:37:37 -07:00
Raymond Hettinger 39dadf7abf Issue 23705: Improve the performance of __contains__ checks for deques. 2015-03-20 16:38:56 -07:00
Serhiy Storchaka 17d3a58e39 Issue #22832: Tweaked parameter names for fcntl module to better match
official POSIX documentation.  Updated the documenttion for Python 3.
Patch by Alex Shkop.
2015-03-20 20:04:21 +02:00
Victor Stinner a453cd8d85 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.
2015-03-20 12:54:28 +01:00
Victor Stinner f50e187724 Fix compiler warnings: comparison between signed and unsigned numbers 2015-03-20 11:32:24 +01:00
Victor Stinner fbd6f9ed12 Issue #23696: Chain ZipImportError to the OSError 2015-03-20 10:52:25 +01:00
Victor Stinner 99953006df 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).
2015-03-20 10:37:34 +01:00
Victor Stinner 716a74ea22 Issue #23001: Fix typo 2015-03-20 10:24:18 +01:00
Serhiy Storchaka 8490f5acfe 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.
2015-03-20 09:00:36 +02:00
Victor Stinner 0eac13052c Issue #23646: Fix test_threading on Windows 2015-03-20 03:06:12 +01:00
Victor Stinner 9a8089b32a 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.
2015-03-20 01:42:20 +01:00
Victor Stinner 4fa99cdb4c 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.
2015-03-20 00:27:28 +01:00
Victor Stinner 54799672da 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().
2015-03-19 23:33:09 +01:00
Victor Stinner 66aab0c4b5 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.
2015-03-19 22:53:20 +01:00
Victor Stinner 79d68f929d 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.
2015-03-19 21:54:09 +01:00
Serhiy Storchaka 009b811d67 Removed unintentional trailing spaces in non-external and non-generated C files. 2015-03-18 21:53:15 +02:00
Victor Stinner cb7e5f6f08 Merge 3.4 (tracemalloc typo) 2015-03-18 16:05:32 +01:00
Victor Stinner 444f124fcf _tracemalloc.c: Fix typo 2015-03-18 16:05:18 +01:00
Victor Stinner e371b3d21a Fix compiler warning in mmapmodule.c (compare signed/unsigned integers) 2015-03-18 15:04:34 +01:00
Victor Stinner 5200f55024 Issue #19428: Handle PyMarshal_Read*() errors in run_pyc_file()
Detect also earlier PyMarshal_Read*() errors in zipimport.
2015-03-18 13:56:25 +01:00
Victor Stinner e42ccd2bfd 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()
2015-03-18 01:39:23 +01:00
Victor Stinner a555cfcb73 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
2015-03-18 00:22:14 +01:00
Victor Stinner f024d263b4 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.
2015-03-17 17:48:27 +01:00
Victor Stinner 0c2fd89777 Revert changeset d927047b1d8eb87738676980a24930d053ba2150
Sorry, it was a mistake, the patch is still under review: issue #23646.
2015-03-17 10:49:17 +01:00
Serhiy Storchaka a60c2fe480 Issue #23641: Cleaned out legacy dunder names from tests and docs.
Fixed 2 to 3 porting bug in pynche.ColorDB.
2015-03-12 21:56:08 +02:00
Victor Stinner 945c82eea3 test 2015-03-12 16:19:01 +01:00
Serhiy Storchaka c2ccce791c Issue #23641: Cleaned out legacy dunder names from tests and docs.
Fixed 2 to 3 porting bug in pynche.ColorDB.
Added few tests for __truediv__, __floordiv__ and __matmul__.
2015-03-12 22:01:30 +02:00
Victor Stinner 95bb714ff7 Issue #23566: enable(), register(), dump_traceback() and dump_traceback_later()
functions of faulthandler now accept file descriptors. Patch by Wei Wu.
2015-03-12 15:32:03 +01:00
Steve Dower 8acde7dcce Issue #23524: Change back to using Windows errors for _Py_fstat instead of the errno shim. 2015-03-07 18:14:07 -08:00
Victor Stinner 35a97c0bed Issue #22524: Fix os.scandir() for platforms which don't have a d_type field in
the dirent structure (ex: OpenIndiana).
2015-03-08 02:59:09 +01:00
Victor Stinner 6036e4431d Issue #22524: New os.scandir() function, part of the PEP 471: "os.scandir()
function -- a better and faster directory iterator". Patch written by Ben
Hoyt.
2015-03-08 01:58:04 +01:00
Victor Stinner 4a7cc88472 Issue #23571: PyObject_Call(), PyCFunction_Call() and call_function() now
raise a SystemError if a function returns a result and raises an exception.
The SystemError is chained to the previous exception.

Refactor also PyObject_Call() and PyCFunction_Call() to make them more readable.

Remove some checks which became useless (duplicate checks).

Change reviewed by Serhiy Storchaka.
2015-03-06 23:35:27 +01:00
Steve Dower d81431f587 Issue #23524: Replace _PyVerify_fd function with calling _set_thread_local_invalid_parameter_handler on every thread. 2015-03-06 14:47:02 -08:00
Ned Deily e37a1946c7 Fix regression introduced by changeset 7c6e3358221a that caused compile
errors of _testcapimodule.c with older versions of gcc.
2015-03-05 15:47:10 -08:00
Serhiy Storchaka caa01f861c Fixed GCC version testing. 2015-03-05 23:42:24 +02:00
Victor Stinner a4c727131e Fix "GCC diagnostic" in socketmodule.c
Fix regression of changeset 7c6e3358221a on GCC < 4.4. The _socket module
cannot be compiled on "x86 FreeBSD 7.2 3.x" buildbot anymore.
2015-03-05 14:04:03 +01:00
Benjamin Peterson de8eca4638 merge 3.4 2015-03-04 22:50:25 -05:00