Commit Graph

3583 Commits

Author SHA1 Message Date
Victor Stinner 6b2ed38509
bpo-42591: Export missing Py_FrozenMain() symbol (GH-23730) (GH-23734)
Export the Py_FrozenMain() function: fix a Python 3.9.0 regression.
Python 3.9 uses -fvisibility=hidden and the function was not exported
explicitly and so not exported.

(cherry picked from commit b5c7b38f5e)
2020-12-15 00:31:54 +01:00
Łukasz Langa 170dec3598
Post 3.9.1 2020-12-08 03:09:53 +01:00
Łukasz Langa 1e5d33e9b9
Python 3.9.1 2020-12-07 15:02:38 +01:00
Łukasz Langa 761c5a1ce4
Post 3.9.1rc1 2020-11-26 18:49:45 +01:00
Łukasz Langa 88db374422
Python 3.9.1rc1 2020-11-24 17:48:47 +01:00
Victor Stinner 05a5d697f4
bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347)
bpo-41686, bpo-41713: On Windows, the SIGINT event,
_PyOS_SigintEvent(), is now created even if Python is configured to
not install signal handlers (PyConfig.install_signal_handlers=0 or
Py_InitializeEx(0)).
2020-11-17 18:58:12 +01:00
Victor Stinner ec306a2fd9
bpo-41617: Add _Py__has_builtin() macro (GH-23260) (GH-23262)
Fix building pycore_bitutils.h internal header on old clang version
without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7).

Add a new private _Py__has_builtin() macro to check for availability
of a preprocessor builtin function.

Co-Authored-By: Joshua Root <jmr@macports.org>

Co-authored-by: Joshua Root <jmr@macports.org>
(cherry picked from commit b3b98082c5)
2020-11-13 16:38:06 +01:00
Miss Skeleton (bot) ebc5a6b59e
bpo-41986: Add Py_FileSystemDefaultEncodeErrors and Py_UTF8Mode back to limited API (GH-22621)
(cherry picked from commit 637a09b0d6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-10-10 07:32:09 -07:00
Łukasz Langa 1691435fe7
Post 3.9.0 2020-10-05 18:07:40 +02:00
Łukasz Langa 9cf6752276
Python 3.9.0 2020-10-05 17:07:58 +02:00
Pablo Galindo d6360891b3
Fix a compiler warning in pycore_pylifecycle.h (GH-22331) 2020-10-04 18:35:07 +02:00
Miss Islington (bot) df71b65a88
bpo-41875: Use __builtin_unreachable when possible (GH-22433)
(cherry picked from commit 24ba3b0df5)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-10-04 18:19:34 +02:00
Łukasz Langa 1f7c99ccf6
Post 3.9.0rc2 2020-09-17 10:45:49 +02:00
Łukasz Langa 2bd31b5fde
Python 3.9.0rc2 2020-09-16 23:23:13 +02:00
Pablo Galindo 55e0836849
[3.9] bpo-41631: _ast module uses again a global state (GH-21961) (GH-22258)
Partially revert commit ac46eb4ad6662cf6d771b20d8963658b2186c48c:
"bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)".

Using a module state per module instance is causing subtle practical
problems.

For example, the Mercurial project replaces the __import__() function
to implement lazy import, whereas Python expected that "import _ast"
always return a fully initialized _ast module.

Add _PyAST_Fini() to clear the state at exit.

The _ast module has no state (set _astmodule.m_size to 0). Remove
astmodule_traverse(), astmodule_clear() and astmodule_free()
functions..
(cherry picked from commit e5fbe0cbd4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-09-15 20:32:56 +02:00
Victor Stinner 4217b3c128
bpo-41617: Fix pycore_byteswap.h to support clang 3.0 (GH-22042) (GH-22044)
__builtin_bswap16() is not available in LLVM clang 3.0.

(cherry picked from commit e6905e4c82)
2020-09-01 20:54:37 +02:00
Łukasz Langa 6e21a30215
Post 3.9.0rc1 2020-08-11 23:29:16 +02:00
Łukasz Langa 439c93d51f
Python 3.9.0rc1 2020-08-11 20:58:17 +02:00
Miss Islington (bot) b2514c4934
bpo-41098: Doc: Add missing deprecated directives (GH-21162)
PyUnicodeEncodeError_Create has been deprecated with
`Py_DEPRECATED` macro. But it was not documented.
(cherry picked from commit 46e19b61d3)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-08-07 00:49:53 -07:00
Miss Islington (bot) e8dda907fb
bpo-41366: Fix clang warning for sign conversion (GH-21592)
(cherry picked from commit 680254a8dc)

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2020-07-23 01:59:21 -07:00
Łukasz Langa 9e84a2c424
Post 3.9.0b5 2020-07-20 21:34:58 +02:00
Łukasz Langa 8ad7d506ca
Python 3.9.0b5 2020-07-20 19:47:09 +02:00
Miss Islington (bot) a0a6f11678
Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)" (GH-21390)
This partially reverts commit 45ec5b99ae.
(cherry picked from commit b26a0db8ea)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-07-08 02:19:38 -07:00
Miss Islington (bot) 1ce59f0421
bpo-41165: Deprecate PyEval_ReleaseLock() (GH-21309)
(cherry picked from commit 9ce8132e1f)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-07-05 20:25:14 -07:00
Miss Islington (bot) 9c38408708
Uncomment Py_DEPRECATED for Py_UNICODE APIs (GH-21318)
PyUnicode_EncodeDecimal and PyUnicode_TransformDecimalToASCII
are deprecated since Python 3.3.
But Py_DEPRECATED(3.3) was commented out.
(cherry picked from commit 13c90e82b6)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-07-04 19:19:40 -07:00
Łukasz Langa c1feaa5468
Post 3.9.0b4 2020-07-03 18:47:54 +02:00
Łukasz Langa 69dec9c8d2
Python 3.9.0b4 2020-07-02 19:57:45 +02:00
Lysandros Nikolaou 8ae5e8ec81
[3.9] bpo-40939: Deprecate PyNode_Compile (GH-21036)
Automerge-Triggered-By: @pablogsal
2020-06-21 17:07:39 -07:00
Pablo Galindo 5b1a311512
[3.9] Do not emit deprecation warnings inside CPython for old parser APIs (GH-21025) 2020-06-21 21:26:59 +01:00
Lysandros Nikolaou d301d9473e
[3.9] bpo-40939: Deprecate the PyParser_SimpleParse* functions (GH-21012) 2020-06-21 02:15:45 +01:00
Inada Naoki 610a60c601
bpo-36346: Add Py_DEPRECATED to deprecated unicode APIs (GH-20878)
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 2c4928d37e)
2020-06-18 17:30:53 +09:00
Miss Islington (bot) 2c6d6c12c2
bpo-19569: Add a macro to suppress deprecation warnings (GH-9004)
Co-authored-by: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
(cherry picked from commit de4304dad8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-06-16 20:18:02 -07:00
Miss Islington (bot) b498c7f1b3
bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)
On Windows, GH-include "pyerrors.h" no longer defines "snprintf" and
"vsnprintf" macros.

PyOS_snprintf() and PyOS_vsnprintf() should be used to get portable
behavior.

Replace snprintf() calls with PyOS_snprintf() and replace vsnprintf()
calls with PyOS_vsnprintf().
(cherry picked from commit e822e37946)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-15 13:20:10 -07:00
Łukasz Langa 6c645cbdd2
Post 3.9.0b3 2020-06-09 23:35:14 +02:00
Łukasz Langa b484871ba7
Python 3.9.0b3 2020-06-09 20:52:10 +02:00
Łukasz Langa 459cb12a29
Post 3.9.0b2 2020-06-09 02:23:35 +02:00
Łukasz Langa 0b1a1c8c4c
Python 3.9.0b2 2020-06-08 20:41:34 +02:00
Victor Stinner 817506432d
bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var (GH-20605) (GH-20725)
(cherry picked from commit 8f023a2f66)

Co-authored-by: Sandro Mani <manisandro@gmail.com>
2020-06-08 19:36:13 +02:00
Victor Stinner dedaac040f
bpo-40910: Export Py_GetArgcArgv() function (GH-20721) (GH-20723)
Export explicitly the Py_GetArgcArgv() function to the C API and
document the function. Previously, it was exported implicitly which
no longer works since Python is built with -fvisibility=hidden.

* Add PyConfig._orig_argv member.
* Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
* PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
  _PyConfig_Write() responsibility.
* _PyConfig_Write() result type becomes PyStatus instead of void.
* Write an unit test on Py_GetArgcArgv().

(cherry picked from commit e81f6e687d)
2020-06-08 18:44:50 +02:00
Miss Islington (bot) 1e4fa91104
bpo-40724: Support setting buffer slots from type specs (GH-20648) (GH-20683)
This is not part of the limited API but makes the buffer slots available for type specs.
(cherry picked from commit f7c4e23642)
2020-06-07 09:06:40 +02:00
Victor Stinner 6d62dc1ea4
[3.9] bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578) (GH-20618)
* bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571)

Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if
tstate is NULL, the error message contains the current function name.

(cherry picked from commit 3026cad59b)

* bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)

PyOS_InterruptOccurred() now fails with a fatal error if it is called
with the GIL released.

(cherry picked from commit cbe1296922)
2020-06-03 20:16:39 +02:00
Victor Stinner 5d2396c8cf
[3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613)
* bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

(cherry picked from commit c353764fd5)

* bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)

my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().

my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.

test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().

Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.

(cherry picked from commit fa7ab6aa0f)
2020-06-03 17:49:25 +02:00
Miss Islington (bot) 50e847a9eb
bpo-40244: Remove XLC's support from the noreturn flag (GH-20588)
Automerge-Triggered-By: @pablogsal
(cherry picked from commit 033d10bd21)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-06-02 01:39:55 -07:00
Miss Islington (bot) 7f77ac463c
bpo-40696: Fix a hang that can arise after gen.throw() (GH-20287)
This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
(cherry picked from commit 7c30d12bd5)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-05-22 14:35:22 -07:00
Victor Stinner 9512ad74b0
[3.9] bpo-40514: Remove --with-experimental-isolated-subinterpreters in 3.9 (GH-20228)
Remove --with-experimental-isolated-subinterpreters configure option
in Python 3.9: the experiment continues in the master branch, but
it's no longer needed in 3.9.
2020-05-20 00:27:46 +02:00
Łukasz Langa 5e6f198bdb
Post 3.9.0b1 2020-05-19 02:12:30 +02:00
Łukasz Langa 97fe9cfd9f
Python 3.9.0b1 2020-05-19 01:07:09 +02:00
Chris Jerdonek da742ba826
bpo-31033: Improve the traceback for cancelled asyncio tasks (GH-19951)
When an asyncio.Task is cancelled, the exception traceback now
starts with where the task was first interrupted.  Previously,
the traceback only had "depth one."
2020-05-17 22:47:31 -07:00
Chris Jerdonek 1aa8767baf
Update code comment re: location of struct _is. (GH-20067) 2020-05-14 19:11:00 -07:00
Victor Stinner a482dc500b
bpo-40602: Write unit tests for _Py_hashtable_t (GH-20091)
Cleanup also hashtable.c.
Rename _Py_hashtable_t members:

* Rename entries to nentries
* Rename num_buckets to nbuckets
2020-05-14 21:55:47 +02:00