summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* pytime.c: rename pygettimeofday_new() to pygettimeofday()Victor Stinner2015-11-101-3/+3
| | | | I forgot to rename it in my previous refactoring of pytime.c.
* Issue #25555: Fix parser and AST: fill lineno and col_offset of "arg" node whenVictor Stinner2015-11-062-8/+32
| | | | compiling AST from Python objects.
* Issue #24802: Merge null termination fixes from 3.4 into 3.5Martin Panter2015-11-071-16/+32
|\
| * Issue #24802: Copy bytes-like objects to null-terminated buffers if necessaryMartin Panter2015-11-071-16/+32
| | | | | | | | | | | | | | | | This avoids possible buffer overreads when int(), float(), compile(), exec() and eval() are passed bytes-like objects. Similar code is removed from the complex() constructor, where it was not reachable. Patch by John Leitch, Serhiy Storchaka and Martin Panter.
* | Issue #25556: Fix LOAD_GLOBAL bytecode when globals type is not dict and theVictor Stinner2015-11-051-0/+4
| | | | | | | | | | | | requested name doesn't exist in globals: clear the KeyError exception before calling PyObject_GetItem(). Fail also if the raised exception is not a KeyError.
* | Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5Martin Panter2015-11-022-2/+2
|\ \ | |/
| * Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-022-2/+2
| | | | | | | | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* | sys.setrecursionlimit() now raises RecursionErrorVictor Stinner2015-10-121-3/+26
| | | | | | | | | | | | | | Issue #25274: sys.setrecursionlimit() now raises a RecursionError if the new recursion limit is too low depending at the current recursion depth. Modify also the "lower-water mark" formula to make it monotonic. This mark is used to decide when the overflowed flag of the thread state is reset.
* | Close #24784: Fix compilation without thread supportVictor Stinner2015-10-111-0/+6
| | | | | | | | | | | | | | | | Add "#ifdef WITH_THREAD" around cals to: * PyGILState_Check() * _PyImport_AcquireLock() * _PyImport_ReleaseLock()
* | Issue #24402: Merge input() fix from 3.4 into 3.5Martin Panter2015-10-101-1/+3
|\ \ | |/
| * Issue #24402: Fix input() when stdout.fileno() fails; diagnosed by EryksunMartin Panter2015-10-101-1/+3
| | | | | | | | Also factored out some test cases into a new PtyTests class.
* | Merge typo fixes from 3.4 into 3.5Martin Panter2015-10-071-1/+1
|\ \ | |/
| * Various minor typos in documentation and commentsMartin Panter2015-10-071-2/+2
| |
* | Issue #25280: Import trace messages emitted in verbose (-v) mode are noSerhiy Storchaka2015-10-011-56/+57
|\ \ | |/ | | | | longer formatted twice.
| * Issue #25280: Import trace messages emitted in verbose (-v) mode are noSerhiy Storchaka2015-10-011-57/+58
| | | | | | | | longer formatted twice.
* | Merge 3.4 (os.urandom)Victor Stinner2015-10-011-0/+2
|\ \ | |/
| * Issue #25003: os.urandom() doesn't use getentropy() on Solaris becauseVictor Stinner2015-10-011-4/+8
| | | | | | | | | | getentropy() is blocking, whereas os.urandom() should not block. getentropy() is supported since Solaris 11.3.
* | Issue #25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom()Victor Stinner2015-10-011-15/+34
| | | | | | | | | | | | function instead of the getentropy() function. The getentropy() function is blocking to generate very good quality entropy, os.urandom() doesn't need such high-quality entropy.
* | make opening brace of container literals and comprehensions correspond to ↵Benjamin Peterson2015-09-261-4/+10
| | | | | | | | the line number and col offset of the AST node (closes #25131)
* | Issue #25155: Fix _PyTime_Divide() roundingVictor Stinner2015-09-181-3/+8
| | | | | | | | | | _PyTime_Divide() rounding was wrong: copy code from Python default which has now much better unit tests.
* | Issue #25155: Add _PyTime_AsTimevalTime_t() functionVictor Stinner2015-09-181-38/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, the tv_sec field of the timeval structure has the type C long, whereas it has the type C time_t on all other platforms. A C long has a size of 32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not enough to store an Epoch timestamp after the year 2038. Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now(): convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t. It allows to support dates after the year 2038 on Windows. Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of seconds when rounding the number of microseconds.
* | Issue #25160: Fix import_init() comments and messagesVictor Stinner2015-09-181-3/+4
| | | | | | | | import_init() imports the "_imp" module, not the "imp" module.
* | compute stack effect of BUILD_MAP correctly (closes #25060)Benjamin Peterson2015-09-112-2/+2
| |
* | Merge from 3.5.0 branch.Steve Dower2015-09-071-2/+70
|\ \
| * | Issue #24305: Prevent import subsystem stack frames from being countedLarry Hastings2015-09-061-2/+70
| | | | | | | | | | | | by the warnings.warn(stacklevel=) parameter.
* | | Merge 3.4 (create_stdio)Victor Stinner2015-09-041-42/+37
|\ \ \ | | |/ | |/|
| * | Fix race condition in create_stdio()Victor Stinner2015-09-041-40/+35
| | | | | | | | | | | | | | | | | | | | | | | | Issue #24891: Fix a race condition at Python startup if the file descriptor of stdin (0), stdout (1) or stderr (2) is closed while Python is creating sys.stdin, sys.stdout and sys.stderr objects. These attributes are now set to None if the creation of the object failed, instead of raising an OSError exception. Initial patch written by Marco Paolini.
| * | Issue #24728: Fix building without threads.Berker Peksag2015-07-271-0/+4
| | | | | | | | | | | | Patch by Louis Dassy.
* | | Issue #24993: Handle import error in namereplace error handlerVictor Stinner2015-09-031-7/+5
| | | | | | | | | | | | | | | Handle PyCapsule_Import() failure (exception) in PyCodec_NameReplaceErrors(): return immedialty NULL.
* | | oops, rename pymonotonic_new() to pymonotonic()Victor Stinner2015-09-021-3/+3
| | | | | | | | | | | | | | | I was not supposed to commit the function with the name pymonotonic_new(). I forgot to rename it.
* | | Issue #24707: Remove assertion in monotonic clockVictor Stinner2015-09-021-10/+0
| |/ |/| | | | | | | | | | | | | | | | | Don't check anymore at runtime that the monotonic clock doesn't go backward. Yes, it happens. It occurs sometimes each month on a Debian buildbot slave running in a VM. The problem is that Python cannot do anything useful if a monotonic clock goes backward. It was decided in the PEP 418 to not fix the system, but only expose the clock provided by the OS.
* | Issue #24975: Fix AST compilation for PEP 448 syntax.Yury Selivanov2015-09-011-2/+4
| |
* | Rebuilt Clinic generated code.Larry Hastings2015-08-252-3/+3
| |
* | Issue #24769: Interpreter now starts properly when dynamic loadingLarry Hastings2015-08-253-25/+75
| | | | | | | | is disabled. Patch by Petr Viktorin.
* | Issue #24492: make sure that ``from ... import ...` raises anBrett Cannon2015-08-121-7/+12
| | | | | | | | | | | | ImportError if __name__ is not defined on a package. Thanks to Armin Rigo for the bug report and diagnosing the cause.
* | Issue #24791: Fix grammar regression for call syntax: 'g(*a or b)'.Yury Selivanov2015-08-052-34/+33
| |
* | py_getrandom(): getrandom() *can* return EINTRVictor Stinner2015-07-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See the latest version of getrandom() manual page: http://man7.org/linux/man-pages/man2/getrandom.2.html#NOTES The behavior when a call to getrandom() that is blocked while reading from /dev/urandom is interrupted by a signal handler depends on the initialization state of the entropy buffer and on the request size, buflen. If the entropy is not yet initialized, then the call will fail with the EINTR error. If the entropy pool has been initialized and the request size is large (buflen > 256), the call either succeeds, returning a partially filled buffer, or fails with the error EINTR. If the entropy pool has been initialized and the request size is small (buflen <= 256), then getrandom() will not fail with EINTR. Instead, it will return all of the bytes that have been requested. Note: py_getrandom() calls getrandom() with flags=0.
* | Fix refleak.Stefan Krah2015-07-271-1/+3
| |
* | Issue #24687: Plug refleak on SyntaxError in function parameters annotations.Yury Selivanov2015-07-231-14/+13
| |
* | Issue #24619: More tests; fix nits in compiler.cYury Selivanov2015-07-222-4/+3
| |
* | set items in dict displays from left to right (closes #24569)Benjamin Peterson2015-07-051-6/+9
| |
* | Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.Yury Selivanov2015-07-033-4/+4
| |
* | Issue #24528: Improve error message for awaits in comprehensionsYury Selivanov2015-06-301-1/+4
| |
* | Issue #24400: Introduce a distinct type for 'async def' coroutines.Yury Selivanov2015-06-224-151/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary of changes: 1. Coroutines now have a distinct, separate from generators type at the C level: PyGen_Type, and a new typedef PyCoroObject. PyCoroObject shares the initial segment of struct layout with PyGenObject, making it possible to reuse existing generators machinery. The new type is exposed as 'types.CoroutineType'. As a consequence of having a new type, CO_GENERATOR flag is no longer applied to coroutines. 2. Having a separate type for coroutines made it possible to add an __await__ method to the type. Although it is not used by the interpreter (see details on that below), it makes coroutines naturally (without using __instancecheck__) conform to collections.abc.Coroutine and collections.abc.Awaitable ABCs. [The __instancecheck__ is still used for generator-based coroutines, as we don't want to add __await__ for generators.] 3. Add new opcode: GET_YIELD_FROM_ITER. The opcode is needed to allow passing native coroutines to the YIELD_FROM opcode. Before this change, 'yield from o' expression was compiled to: (o) GET_ITER LOAD_CONST YIELD_FROM Now, we use GET_YIELD_FROM_ITER instead of GET_ITER. The reason for adding a new opcode is that GET_ITER is used in some contexts (such as 'for .. in' loops) where passing a coroutine object is invalid. 4. Add two new introspection functions to the inspec module: getcoroutinestate(c) and getcoroutinelocals(c). 5. inspect.iscoroutine(o) is updated to test if 'o' is a native coroutine object. Before this commit it used abc.Coroutine, and it was requested to update inspect.isgenerator(o) to use abc.Generator; it was decided, however, that inspect functions should really be tailored for checking for native types. 6. sys.set_coroutine_wrapper(w) API is updated to work with only native coroutines. Since types.coroutine decorator supports any type of callables now, it would be confusing that it does not work for all types of coroutines. 7. Exceptions logic in generators C implementation was updated to raise clearer messages for coroutines: Before: TypeError("generator raised StopIteration") After: TypeError("coroutine raised StopIteration")
* | Added the const qualifier for char* argument of Py_EnterRecursiveCall().Serhiy Storchaka2015-06-211-1/+1
|\ \ | |/
| * Added the const qualifier for char* argument of Py_EnterRecursiveCall().Serhiy Storchaka2015-06-211-1/+1
| |
* | Issue #24436: Added const qualifiers for char* arguments of _PyTraceback_Add.Serhiy Storchaka2015-06-211-1/+1
|\ \ | |/ | | | | Patch by Michael Ensslin.
| * Issue #24436: Added const qualifiers for char* arguments of _PyTraceback_Add.Serhiy Storchaka2015-06-211-1/+1
| | | | | | | | Patch by Michael Ensslin.
* | Fixed indentation of Python examples in C comments.Serhiy Storchaka2015-06-101-2/+2
|\ \ | |/
| * Fixed indentation of Python examples in C comments.Serhiy Storchaka2015-06-101-2/+2
| |