summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Issue #23451, #22117: Python 3.5 now requires Windows Vista or newer, soVictor Stinner2015-03-271-47/+2
| | | | | | | | | | | | GetTickCount64() is now always available.
* | | Issue #22117: Add a new Python timestamp format _PyTime_t to pytime.hVictor Stinner2015-03-271-1/+310
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In practice, _PyTime_t is a number of nanoseconds. Its C type is a 64-bit signed number. It's integer value is in the range [-2^63; 2^63-1]. In seconds, the range is around [-292 years; +292 years]. In term of Epoch timestamp (1970-01-01), it can store a date between 1677-09-21 and 2262-04-11. The API has a resolution of 1 nanosecond and use integer number. With a resolution on 1 nanosecond, 64-bit IEEE 754 floating point numbers loose precision after 194 days. It's not the case with this API. The drawback is overflow for values outside [-2^63; 2^63-1], but these values are unlikely for most Python modules, except of the datetime module. New functions: - _PyTime_GetMonotonicClock() - _PyTime_FromObject() - _PyTime_AsMilliseconds() - _PyTime_AsTimeval() This change uses these new functions in time.sleep() to avoid rounding issues. The new API will be extended step by step, and the old API will be removed step by step. Currently, some code is duplicated just to be able to move incrementally, instead of pushing a large change at once.
* | | Merge 3.4 (traceback)Victor Stinner2015-03-251-1/+8
|\ \ \ | |/ /
| * | Issue #23571: If io.TextIOWrapper constructor fails in _Py_DisplaySourceLine(),Victor Stinner2015-03-251-1/+8
| | | | | | | | | | | | close the binary file to fix a resource warning.
* | | (Merge 3.4) Issue #23571: Fix reentrant call to Py_FatalError()Victor Stinner2015-03-251-17/+28
|\ \ \ | |/ / | | | | | | | | | | | | Flushing sys.stdout and sys.stderr in Py_FatalError() can call again Py_FatalError(). Add a reentrant flag to detect this case and just abort at the second call.
| * | Issue #23571: Fix reentrant call to Py_FatalError()Victor Stinner2015-03-251-17/+28
| | | | | | | | | | | | | | | | | | Flushing sys.stdout and sys.stderr in Py_FatalError() can call again Py_FatalError(). Add a reentrant flag to detect this case and just abort at the second call.
* | | (Merge 3.4) Issue #23571: Py_FatalError() now tries to flush sys.stdout andVictor Stinner2015-03-241-4/+26
|\ \ \ | |/ / | | | | | | | | | | | | | | | sys.stderr It should help to see exceptions when stderr if buffered: PyErr_Display() calls sys.stderr.write(), it doesn't write into stderr file descriptor directly.
| * | Issue #23571: Py_FatalError() now tries to flush sys.stdout and sys.stderrVictor Stinner2015-03-241-4/+26
| | | | | | | | | | | | | | | It should help to see exceptions when stderr if buffered: PyErr_Display() calls sys.stderr.write(), it doesn't write into stderr file descriptor directly.
* | | Issue #23571: PyErr_FormatV() and PyErr_SetObject() now always clear theVictor Stinner2015-03-241-8/+7
| | | | | | | | | | | | | | | current exception because they can run arbitrary Python code and so no exception must be set.
* | | Issue #23753: Move _Py_wstat() from Python/fileutils.c to Modules/getpath.cVictor Stinner2015-03-241-17/+0
| | | | | | | | | | | | | | | | | | | | | 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.
* | | (Merge 3.4) Issue #23571: Enhance Py_FatalError()Victor Stinner2015-03-241-13/+59
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | * Display the current Python stack if an exception was raised but the exception has no traceback * Disable faulthandler if an exception was raised (before it was only disabled if no exception was raised) * To display the current Python stack, call PyGILState_GetThisThreadState() which works even if the GIL was released
| * | Issue #23571: Enhance Py_FatalError()Victor Stinner2015-03-241-13/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Display the current Python stack if an exception was raised but the exception has no traceback * Disable faulthandler if an exception was raised (before it was only disabled if no exception was raised) * To display the current Python stack, call PyGILState_GetThisThreadState() which works even if the GIL was released
* | | Issue #23753: Python doesn't support anymore platforms without stat() orVictor Stinner2015-03-242-20/+0
| | | | | | | | | | | | | | | | | | | | | fstat(), these functions are always required. Remove HAVE_STAT and HAVE_FSTAT defines, and stop supporting DONT_HAVE_STAT and DONT_HAVE_FSTAT.
* | | Issue #23571: _Py_CheckFunctionResult() now gives the name of the functionVictor Stinner2015-03-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Issue #23708: Save/restore errno in _Py_read() and _Py_write()Victor Stinner2015-03-201-15/+21
| | | | | | | | | | | | | | | Save and then restore errno because PyErr_CheckSignals() and PyErr_SetFromErrno() can modify it.
* | | Issue #23708: Split assertion expression in two assertions in _Py_read() andVictor Stinner2015-03-201-2/+4
| | | | | | | | | | | | _Py_write() to know which test failed on the buildbot "AMD64 Snow Leop 3.x".
* | | Cleanup pytime.c: add XXX_TO_YYY constants (ex: SEC_TO_US)Victor Stinner2015-03-201-13/+19
| | |
* | | Issue #23646: Enhance precision of time.sleep() and socket timeout whenVictor Stinner2015-03-201-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Issue #23708: Fix _Py_read() compilation error on WindowsVictor Stinner2015-03-191-1/+1
| | | | | | | | | | | | Fix typo: self->fd => fd
* | | Issue #23707: On UNIX, os.urandom() now calls the Python signal handler whenVictor Stinner2015-03-191-19/+11
| | | | | | | | | | | | | | | | | | | | | read() is interrupted by a signal. dev_urandom_python() now calls _Py_read() helper instead of calling directly read().
* | | Issue #22181: Fix dev_urandom_noraise(), try calling py_getrandom() beforeVictor Stinner2015-03-191-4/+4
| | | | | | | | | | | | opening /dev/urandom.
* | | Issue #23708: Add _Py_read() and _Py_write() functions to factorize code handleVictor Stinner2015-03-191-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Issue #22181: The availability of the getrandom() is now checked in configure,Victor Stinner2015-03-191-8/+5
| | | | | | | | | | | | | | | | | | and stored in pyconfig.h as the new HAVE_GETRANDOM_SYSCALL define. Fix os.urandom() tests using file descriptors if os.urandom() uses getrandom().
* | | Removed unintentional trailing spaces in non-external and non-generated C files.Serhiy Storchaka2015-03-184-12/+12
| | |
* | | Initialize variables to prevent GCC warningsVictor Stinner2015-03-182-3/+5
| | |
* | | Fix compiler warning in dtoa.cVictor Stinner2015-03-181-2/+2
| | |
* | | Issue #22181: On Linux, os.urandom() now uses the new getrandom() syscall ifVictor Stinner2015-03-181-6/+84
| | | | | | | | | | | | | | | | | | 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.
* | | Issue #19428: Handle PyMarshal_Read*() errors in run_pyc_file()Victor Stinner2015-03-181-2/+6
| | | | | | | | | | | | Detect also earlier PyMarshal_Read*() errors in zipimport.
* | | Issue #23694: Handle EINTR in _Py_open() and _Py_fopen_obj()Victor Stinner2015-03-181-13/+40
| | | | | | | | | | | | | | | Retry open()/fopen() if it fails with EINTR and the Python signal handler doesn't raise an exception.
* | | Issue #23694: Enhance _Py_fopen(), it now raises an exception on errorVictor Stinner2015-03-183-14/+40
| | | | | | | | | | | | | | | * If fopen() fails, OSError is raised with the original filename object. * The GIL is now released while calling fopen()
* | | Issue #23694: Enhance _Py_open(), it now raises exceptionsVictor Stinner2015-03-172-24/+58
| | | | | | | | | | | | | | | | | | | | | | | | * _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
* | | Issue #23571: Restore removed assert(!PyErr_Occurred()); inVictor Stinner2015-03-161-0/+7
| | | | | | | | | | | | | | | | | | | | | PyEval_CallObjectWithKeywords() Sorry Serhiy, I missed your explanation because the review email was moved to my Spam folder :-(
* | | Fixes incorrect use of GetLastError where errno should be used.Steve Dower2015-03-141-6/+6
|\ \ \ | |/ /
| * | Fixes incorrect use of GetLastError where errno should be used.Steve Dower2015-03-141-6/+6
| | |
* | | Issue #23192: Fixed generator lambdas. Patch by Bruno Cauet.Serhiy Storchaka2015-03-111-2/+2
|\ \ \ | |/ /
| * | Issue #23192: Fixed generator lambdas. Patch by Bruno Cauet.Serhiy Storchaka2015-03-111-2/+2
| | |
* | | Issue #23524: Change back to using Windows errors for _Py_fstat instead of ↵Steve Dower2015-03-081-3/+5
| | | | | | | | | | | | the errno shim.
* | | Issue #23571: PyObject_Call(), PyCFunction_Call() and call_function() nowVictor Stinner2015-03-061-19/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Issue #23524: Replace _PyVerify_fd function with calling ↵Steve Dower2015-03-062-5/+114
| | | | | | | | | | | | _set_thread_local_invalid_parameter_handler on every thread.
* | | Issue #23451: Update pyconfig.h for Windows to require Vista headers and ↵Steve Dower2015-03-022-47/+10
| | | | | | | | | | | | remove unnecessary version checks.
* | | Issue #23152: Renames time_t_to_FILE_TIME to _Py_time_t_to_FILE_TIME, ↵Steve Dower2015-02-211-4/+2
| | | | | | | | | | | | removes unused struct win32_stat and return value
* | | Issue #23152: Renames attribute_data_to_stat to _Py_attribute_data_to_statSteve Dower2015-02-211-2/+2
| | |
* | | Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on ↵Steve Dower2015-02-215-15/+157
| | | | | | | | | | | | | | | | | | Windows. fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
* | | Issue #22883: Got rid of outdated references to PyInt and PyString in comments.Serhiy Storchaka2015-02-171-1/+1
| | |
* | | Issue #23450: Silenced compiler warnings and added asserts in peephole ↵Serhiy Storchaka2015-02-161-3/+9
| | | | | | | | | | | | optimizer.
* | | Issue #23450: Fixed possible integer overflows.Serhiy Storchaka2015-02-162-2/+2
| | |
* | | Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integerSerhiy Storchaka2015-02-161-2/+2
|\ \ \ | |/ / | | | | | | overflows. Added few missed PyErr_NoMemory().
| * | Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integerSerhiy Storchaka2015-02-161-2/+2
| | | | | | | | | | | | overflows. Added few missed PyErr_NoMemory().
* | | Fixed few compiler warnings.Serhiy Storchaka2015-02-163-5/+5
| | |
* | | merge 3.4 (#22633)Benjamin Peterson2015-02-141-6/+9
|\ \ \ | |/ /