| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Redundant code leftover from cleanup in #16191: the variable `err` is being written to, even though it wasn't used after that point.
|
|
|
| |
bpo-30604: port fix from 3.6 dropping binary compatibility tweaks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-30183: Fixes HP-UX cc compilation error in pytime.c
HP-UX does not support the CLOCK_MONOTONIC identifier, and will fail to
compile:
"Python/pytime.c", line 723: error #2020: identifier
"CLOCK_MONOTONIC" is undefined
const clockid_t clk_id = CLOCK_MONOTONIC;
Add a new section for __hpux that calls 'gethrtime()' instead of
'clock_gettime()'.
* bpo-30183: Removes unnecessary return
|
|
|
|
|
|
|
|
|
|
|
|
| |
- removes PY_WARN_ON_C_LOCALE build time flag
- locale coercion and compatibility warnings are now always compiled
in, but are off by default
- adds PYTHONCOERCECLOCALE=warn runtime option to aid in
debugging potentially locale related compatibility problems
Due to not-yet-resolved test failures on *BSD systems (including
Mac OS X), this also temporarily disables UTF-8 as a locale coercion
target, and skips testing the interpreter's behavior in the POSIX locale.
|
|
|
|
|
|
| |
(#2232)
This caused a segfault on eval("f'\\\n'") and eval("f'\\\r'") in debug build.
|
|
|
|
| |
In rare circumstances PyImport_Import() could return NULL without raising
an error.
|
| |
|
|
|
|
| |
expressions. (#1851)
|
|
|
|
|
|
|
|
|
|
| |
- new PYTHONCOERCECLOCALE config setting
- coerces legacy C locale to C.UTF-8, C.utf8 or UTF-8 by default
- always uses C.UTF-8 on Android
- uses `surrogateescape` on stdin and stdout in the coercion
target locales
- configure option to disable locale coercion at build time
- configure option to disable C locale warning at build time
|
|
|
|
|
|
|
|
| |
The function '_PyArg_ParseStack()' and
'_PyArg_UnpackStack' were failing (with error
"XXX() takes Y argument (Z given)") before
the function '_PyArg_NoStackKeywords()' was called.
Thus, the latter did not raise its more meaningful
error : "XXX() takes no keyword arguments".
|
|
|
|
|
|
|
|
| |
* Fix regression in error message introduced in bpo-29951.
* Add test.
* Make the test more strong.
|
|
|
|
|
|
|
|
| |
(#1888)
'invalid character in identifier' now is raised instead of
'f-string: empty expression not allowed' if a subexpression contains
only whitespaces and they are not accepted by Python parser.
|
|
|
|
|
| |
Error messages when pass keyword arguments to some builtins that
don't support keyword arguments contained double parenthesis: "()()".
The regression was introduced by bpo-30534.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a reference in subinterpreters, like test_callbacks_leak() of
test_atexit.
warnoptions is a list used to pass options from the command line to
the sys module constructor. Before this change, the list was shared
by multiple interpreter which is not the expected behaviour. Each
interpreter should have their own independent mutable world.
This change duplicates the list in each interpreter. So each
interpreter owns its own list, so each interpreter can clear its own
list.
|
|
|
|
|
|
|
|
| |
Fix regressions introduced by:
- bpo-22257: commits 1abcf6700b4da6207fe859de40c6c1bada6b4fec and 6b4be195cd8868b76eb6fbe166acc39beee8ce36
Co-Authored-By: Victor Stinner <victor.stinner@gmail.com>
Co-Authored-By: Louie Lu <git@louie.lu>
|
|
|
|
|
|
|
| |
to functions implemented in C that don't support this.
Also unified error messages for functions that don't take positional or keyword
arguments.
|
| |
|
| |
|
|
|
|
|
|
| |
* bpo-16500: Use register_at_fork() in the threading module
* Update comment at top of _after_fork()
|
|
|
|
|
|
| |
* Doc nits for bpo-16500
* Fix more references
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-16500: Allow registering at-fork handlers
* Address Serhiy's comments
* Add doc for new C API
* Add doc for new Python-facing function
* Add NEWS entry + doc nit
|
| |
|
| |
|
| |
|
|
|
| |
(patch by Nick Coghlan)
|
|
|
| |
(patch by Nick Coghlan)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Improves test_underpth_nosite_file to reveal why it fails.
* Enable building with Windows 10 SDK.
* Fix WinSDK detection
* Fix initialization on Windows when a ._pth file exists.
* Fix tabs
* Adds comment about Py_GetPath call.
|
| |
|
|
|
| |
PEP 432 specifies a number of large changes to interpreter startup code, including exposing a cleaner C-API. The major changes depend on a number of smaller changes. This patch includes all those smaller changes.
|
| |
|
|
|
|
| |
head_lock could be held by another thread when fork happened. We should
reset it to avoid deadlock.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we have a chain of generators/coroutines that are 'yield from'ing
each other, then resuming the stack works like:
- call send() on the outermost generator
- this enters _PyEval_EvalFrameDefault, which re-executes the
YIELD_FROM opcode
- which calls send() on the next generator
- which enters _PyEval_EvalFrameDefault, which re-executes the
YIELD_FROM opcode
- ...etc.
However, every time we enter _PyEval_EvalFrameDefault, the first thing
we do is to check for pending signals, and if there are any then we
run the signal handler. And if it raises an exception, then we
immediately propagate that exception *instead* of starting to execute
bytecode. This means that e.g. a SIGINT at the wrong moment can "break
the chain" – it can be raised in the middle of our yield from chain,
with the bottom part of the stack abandoned for the garbage collector.
The fix is pretty simple: there's already a special case in
_PyEval_EvalFrameEx where it skips running signal handlers if the next
opcode is SETUP_FINALLY. (I don't see how this accomplishes anything
useful, but that's another story.) If we extend this check to also
skip running signal handlers when the next opcode is YIELD_FROM, then
that closes the hole – now the exception can only be raised at the
innermost stack frame.
This shouldn't have any performance implications, because the opcode
check happens inside the "slow path" after we've already determined
that there's a pending signal or something similar for us to process;
the vast majority of the time this isn't true and the new check
doesn't run at all.
|
| |
|
|
|
| |
a submodule to a name are now supported.
|
|
|
|
|
|
| |
Python/thread_foobar.h is the template code that is threading adaptation
for new platforms, also hasn't been used on actual platforms.
Python/thread_*.h give concrete examples of adaptation instead of the
template code.
|
|
|
|
|
| |
is_valid_fd() now uses fstat() instead of dup() on macOS to return 0
on a pipe when the other side of the pipe is closed. fstat() fails
with EBADF in that case, whereas dup() succeed.
|
|
|
|
|
|
| |
raised an error.
Replace them with using concrete types API that never fails if appropriate.
|
| |
|
|
|
|
|
|
| |
slots. (#700)
Negative result should be returned only when an error is set.
|
|
|
|
|
|
|
| |
`PyArg_ParseTuple*` (#916)
Also changed format specifier for function name from "%s" to "%.200s"
and exception messages should start with lowercase letter.
|
|
|
|
|
| |
deque (#887)
when pass indices of wrong type.
|
|
|
| |
if pass `accept={int, NoneType}`.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-6532: Make the thread id an unsigned integer.
From C API side the type of results of PyThread_start_new_thread() and
PyThread_get_thread_ident(), the id parameter of
PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState
changed from "long" to "unsigned long".
* Restore a check in thread_get_ident().
|
| |
|
|
|
|
| |
(#748)
|
| |
|
| |
|
|
|
|
|
| |
if attributes "encoding" or "errors" of sys.stdin or sys.stdout
are not set or are not strings.
|
| |
|