Victor Stinner
a3c0202eb5
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.
11 years ago
Victor Stinner
7f04d4d4b7
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".
11 years ago
Victor Stinner
580ef1345a
Cleanup pytime.c: add XXX_TO_YYY constants (ex: SEC_TO_US)
11 years ago
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.
11 years ago
Victor Stinner
c1cf4f7ef9
Issue #23708 : Fix _Py_read() compilation error on Windows
Fix typo: self->fd => fd
11 years ago
Victor Stinner
c9382eb7ae
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().
11 years ago
Victor Stinner
c7cd12da60
Issue #22181 : Fix dev_urandom_noraise(), try calling py_getrandom() before
opening /dev/urandom.
11 years ago
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.
11 years ago
Victor Stinner
9eb57c5fa5
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().
11 years ago
Serhiy Storchaka
009b811d67
Removed unintentional trailing spaces in non-external and non-generated C files.
11 years ago
Victor Stinner
0c39b1b970
Initialize variables to prevent GCC warnings
11 years ago
Victor Stinner
938b0b9fee
Fix compiler warning in dtoa.c
11 years ago
Victor Stinner
59f7fb29ec
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.
11 years ago
Victor Stinner
5200f55024
Issue #19428 : Handle PyMarshal_Read*() errors in run_pyc_file()
Detect also earlier PyMarshal_Read*() errors in zipimport.
11 years ago
Victor Stinner
a47fc5c2dd
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.
11 years ago
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()
11 years ago
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
11 years ago
Victor Stinner
59b356d659
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 :-(
11 years ago
Steve Dower
41e7244c06
Fixes incorrect use of GetLastError where errno should be used.
11 years ago
Serhiy Storchaka
c775ad615a
Issue #23192 : Fixed generator lambdas. Patch by Bruno Cauet.
11 years ago
Steve Dower
8acde7dcce
Issue #23524 : Change back to using Windows errors for _Py_fstat instead of the errno shim.
11 years ago
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.
11 years ago
Steve Dower
d81431f587
Issue #23524 : Replace _PyVerify_fd function with calling _set_thread_local_invalid_parameter_handler on every thread.
11 years ago
Steve Dower
3e96f324dc
Issue #23451 : Update pyconfig.h for Windows to require Vista headers and remove unnecessary version checks.
11 years ago
Steve Dower
bf1f376b3e
Issue #23152 : Renames time_t_to_FILE_TIME to _Py_time_t_to_FILE_TIME, removes unused struct win32_stat and return value
11 years ago
Steve Dower
a2af1a5a5a
Issue #23152 : Renames attribute_data_to_stat to _Py_attribute_data_to_stat
11 years ago
Steve Dower
f2f373f593
Issue #23152 : Implement _Py_fstat() to support files larger than 2 GB on Windows.
fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
11 years ago
Serhiy Storchaka
483405bcca
Issue #22883 : Got rid of outdated references to PyInt and PyString in comments.
11 years ago
Serhiy Storchaka
67559bf8f1
Issue #23450 : Silenced compiler warnings and added asserts in peephole optimizer.
11 years ago
Serhiy Storchaka
26861b0b29
Issue #23450 : Fixed possible integer overflows.
11 years ago
Serhiy Storchaka
1a1ff29659
Issue #23446 : Use PyMem_New instead of PyMem_Malloc to avoid possible integer
overflows. Added few missed PyErr_NoMemory().
11 years ago
Serhiy Storchaka
53fa8b2a4b
Fixed few compiler warnings.
11 years ago
Benjamin Peterson
2476b98acf
avoid reading unallocated memory when argc == 0 ( closes #22633 )
11 years ago
Serhiy Storchaka
c07422c119
Splitted the WFILE structure to WFILE and RFILE.
11 years ago
Serhiy Storchaka
c1efe5f039
Issue #23344 : marshal.dumps() is now 20-25% faster on average.
11 years ago
Serhiy Storchaka
ce921c62cc
Issue #20416 : marshal.dumps() with protocols 3 and 4 is now 40-50% faster on
average.
11 years ago
Serhiy Storchaka
4fdb68491e
Issue #22896 : Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()
and PyObject_AsWriteBuffer().
11 years ago
Benjamin Peterson
7a66fc22ad
revert lineno and col_offset changes from #16795 ( closes #21295 )
11 years ago
Victor Stinner
26f7b8acdc
Issue #23353 : Fix the exception handling of generators in PyEval_EvalFrameEx().
At entry, save or swap the exception state even if PyEval_EvalFrameEx() is
called with throwflag=0. At exit, the exception state is now always restored or
swapped, not only if why is WHY_YIELD or WHY_RETURN. Patch co-written with
Antoine Pitrou.
11 years ago
Serhiy Storchaka
000daaee57
Fixed memory leak in marshal.
11 years ago
Serhiy Storchaka
07985ef387
Issue #22286 : The "backslashreplace" error handlers now works with
decoding and translating.
11 years ago
Serhiy Storchaka
d3faf43f9b
Issue #23181 : More "codepoint" -> "code point".
11 years ago
Brett Cannon
02d8454002
Issue #23014 : Make importlib.abc.Loader.create_module() required when
importlib.abc.Loader.exec_module() is also defined.
Before this change, create_module() was optional **and** could return
None to trigger default semantics. This change now reduces the
options for choosing default semantics to one and in the most
backporting-friendly way (define create_module() to return None).
11 years ago
Benjamin Peterson
f18bf6fd2d
add some overflow checks before multiplying ( closes #23165 )
11 years ago
Benjamin Peterson
47e782a67a
update for copyright for 2015
11 years ago
Victor Stinner
fe02e39029
Issue #22585 : On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(),
instead of reading /dev/urandom, to get pseudo-random bytes.
11 years ago
Victor Stinner
4d6a3d6c01
Issue #22585 : On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(),
instead of reading /dev/urandom, to get pseudo-random bytes.
11 years ago
Steve Dower
03a144bb6a
#22980 Adds platform and version tags to .pyd files
11 years ago
Zachary Ware
cd441c4a79
Update Python/importlib.h
11 years ago
Benjamin Peterson
3cda0ed062
pop the loop block even for infinite while loops ( closes #23048 )
11 years ago