]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 years agobpo-43988: Fix test.support.check_disallow_instantiation version added (GH-26889)
Erlend Egeberg Aasland [Thu, 24 Jun 2021 07:57:14 +0000 (09:57 +0200)] 
bpo-43988: Fix test.support.check_disallow_instantiation version added (GH-26889)

Automerge-Triggered-By: GH:vstinner
4 years agobpo-43693 Get rid of CO_NOFREE -- it's unused (GH-26839)
Guido van Rossum [Wed, 23 Jun 2021 16:51:44 +0000 (09:51 -0700)] 
bpo-43693 Get rid of CO_NOFREE -- it's unused (GH-26839)

All uses of this flag are either setting it
or in doc or tests for it. So we should be
able to get rid of it completely.

4 years agobpo-42862: Strip stale sqlite3 cache ignores from c-analyzer (GH-26876)
Erlend Egeberg Aasland [Wed, 23 Jun 2021 14:04:26 +0000 (16:04 +0200)] 
bpo-42862: Strip stale sqlite3 cache ignores from c-analyzer (GH-26876)

4 years agobpo-39947: Remove old private trashcan C API functions (GH-26869)
Victor Stinner [Wed, 23 Jun 2021 13:51:47 +0000 (15:51 +0200)] 
bpo-39947: Remove old private trashcan C API functions (GH-26869)

Remove 4 C API private trashcan functions which were only kept for
the backward compatibility of the stable ABI with Python 3.8 and
older, since the trashcan API was not usable with the limited C API
on Python 3.8 and older. The trashcan API was excluded from the
limited C API in Python 3.9.

Removed functions:

* _PyTrash_deposit_object()
* _PyTrash_destroy_chain()
* _PyTrash_thread_deposit_object()
* _PyTrash_thread_destroy_chain()

The trashcan C API was never usable with the limited C API, since old
trashcan macros accessed directly PyThreadState members like
"_tstate->trash_delete_nesting", whereas the PyThreadState structure
is opaque in the limited C API.

Exclude also the PyTrash_UNWIND_LEVEL constant from the C API.

The trashcan C API was modified in Python 3.9 by commit
38965ec5411da60d312b59be281f3510d58e0cf1 and in Python 3.10 by commit
ed1a5a5baca8f61e9a99c5be3adc16b1801514fe to hide implementation
details.

4 years agobpo-43770: Cleanup PyModuleDef_Init() (GH-26879)
Victor Stinner [Wed, 23 Jun 2021 13:40:27 +0000 (15:40 +0200)] 
bpo-43770:  Cleanup PyModuleDef_Init() (GH-26879)

PyModuleDef_Init() no longer tries to make PyModule_Type type: it's
already done by _PyTypes_Init() at Python startup. Replace
PyType_Ready() call with an assertion.

4 years agobpo-42064: Move `sqlite3` exceptions to global state, part 1 of 2 (GH-26745)
Erlend Egeberg Aasland [Wed, 23 Jun 2021 12:56:40 +0000 (14:56 +0200)] 
bpo-42064: Move `sqlite3` exceptions to global state, part 1 of 2 (GH-26745)

Also adds a test to verify the (borrowed) exceptions in `sqlite3.Connection`.

4 years agobpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874)
Victor Stinner [Wed, 23 Jun 2021 12:13:27 +0000 (14:13 +0200)] 
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874)

Py_RunMain() now resets PyImport_Inittab to its initial value at
exit. It must be possible to call PyImport_AppendInittab() or
PyImport_ExtendInittab() at each Python initialization.

4 years agobpo-42064: Remove stale extern declarations in `sqlite3` headers (GH-26840)
Erlend Egeberg Aasland [Wed, 23 Jun 2021 12:06:53 +0000 (14:06 +0200)] 
bpo-42064: Remove stale extern declarations in `sqlite3` headers (GH-26840)

4 years agobpo-44404: tkinter `after` support callable classes (GH-26812)
E-Paine [Wed, 23 Jun 2021 10:30:24 +0000 (11:30 +0100)] 
bpo-44404: tkinter `after` support callable classes (GH-26812)

4 years agobpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations...
Serhiy Storchaka [Wed, 23 Jun 2021 09:53:37 +0000 (12:53 +0300)] 
bpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations (GH-26843)

4 years agobpo-28395: Remove unnecessary semicolons in tests (GH-26868)
Dong-hee Na [Wed, 23 Jun 2021 09:01:06 +0000 (18:01 +0900)] 
bpo-28395: Remove unnecessary semicolons in tests (GH-26868)

4 years agobpo-44486: Make sure that modules always have a dictionary. (GH-26847)
Mark Shannon [Wed, 23 Jun 2021 09:00:43 +0000 (10:00 +0100)] 
bpo-44486: Make sure that modules always have a dictionary. (GH-26847)

* Make sure that modules always have a dictionary.

4 years agoFix typo in test_typing.py (GH-26853)
Ikko Ashimine [Tue, 22 Jun 2021 22:42:28 +0000 (07:42 +0900)] 
Fix typo in test_typing.py (GH-26853)

maximium -> maximum

4 years agobpo-43918: document signature and default argument of `anext` builtin (#25551)
Erik Welch [Tue, 22 Jun 2021 21:00:51 +0000 (16:00 -0500)] 
bpo-43918: document signature and default argument of `anext` builtin (#25551)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
4 years ago[doc] Improve punctuation atexit doc
Géry Ogam [Tue, 22 Jun 2021 16:49:12 +0000 (18:49 +0200)] 
[doc] Improve punctuation atexit doc

4 years agobpo-40528: Implement a metadata system for ASDL Generator (GH-20193)
Batuhan Taskaya [Tue, 22 Jun 2021 16:29:42 +0000 (19:29 +0300)] 
bpo-40528: Implement a metadata system for ASDL Generator (GH-20193)

ASDL Generator was lack of proper annotation related to generated
module. This patch implements a MetadataVisitor that produces a
metadata object to pass to other visitors that are visiting that
same module. For the inital patch, it dynamically retrieves int
sequences (like cmpop), that was previously hardcoded. It offers
an interface that is easy to extend.

4 years agobpo-41621: Document defaultdict's default_factory parameter (GH-21945)
Dennis Sweeney [Tue, 22 Jun 2021 14:19:24 +0000 (10:19 -0400)] 
bpo-41621: Document defaultdict's default_factory parameter (GH-21945)

It defaults to None and is positional only.

4 years agobpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848)
Ken Jin [Tue, 22 Jun 2021 13:54:44 +0000 (21:54 +0800)] 
bpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848)

4 years agobpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly (GH...
Ma Lin [Tue, 22 Jun 2021 07:04:23 +0000 (15:04 +0800)] 
bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly (GH-26764)

No longer use len() to get the length of the input data. For some buffer protocol objects,
the length obtained by using len() is wrong.

4 years agobpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808)
Russell Keith-Magee [Tue, 22 Jun 2021 06:36:36 +0000 (14:36 +0800)] 
bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808)

* bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated.

4 years agobpo-44287: asyncio test_popen() uses longer timeout (GH-26832)
Victor Stinner [Mon, 21 Jun 2021 23:58:19 +0000 (01:58 +0200)] 
bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)

Fix asyncio test_popen() of test_windows_utils by using a longer
timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT
timeout rather than a hardcoded timeout of 10 seconds: it's 30
seconds by default, but it is made longer on slow buildbots.

WaitForMultipleObjects() timeout argument is in milliseconds.

4 years agobpo-13814: Explain why generators are not context managers (GH-26835)
Terry Jan Reedy [Mon, 21 Jun 2021 21:23:29 +0000 (17:23 -0400)] 
bpo-13814: Explain why generators are not context managers (GH-26835)

Put entry in Design FAQ after a question about a context manager for assignment.
Original patch by Aidan Lowe.

4 years agobpo-43693: Turn localspluskinds into an object (GH-26749)
Guido van Rossum [Mon, 21 Jun 2021 20:53:04 +0000 (13:53 -0700)] 
bpo-43693: Turn localspluskinds into an object (GH-26749)

Managing it as a bare pointer to malloc'ed bytes is just too awkward in a few places.

4 years agoReset DeprecationWarning filters in test_typing io and re (#26811)
Ken Jin [Mon, 21 Jun 2021 18:17:55 +0000 (02:17 +0800)] 
Reset DeprecationWarning filters in test_typing io and re (#26811)

4 years agobpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822)
Pablo Galindo [Mon, 21 Jun 2021 15:23:53 +0000 (16:23 +0100)] 
bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822)

4 years agobpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685)
Dong-hee Na [Mon, 21 Jun 2021 13:59:02 +0000 (22:59 +0900)] 
bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685)

4 years agobpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758)
Victor Stinner [Mon, 21 Jun 2021 11:16:18 +0000 (13:16 +0200)] 
bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758)

_thread.start_new_thread() no longer calls PyThread_exit_thread()
explicitly at the thread exit, the call was redundant.

On Linux with the glibc, pthread_cancel() loads dynamically the
libgcc_s.so.1 library. dlopen() can fail if there is no more
available file descriptor to open the file. In this case, the process
aborts with the error message:

"libgcc_s.so.1 must be installed for pthread_cancel to work"

pthread_cancel() unwinds back to the thread's wrapping function that
calls the thread entry point.

The unwind function is dynamically loaded from the libgcc_s library
since it is tightly coupled to the C compiler (GCC). The unwinder
depends on DWARF, the compiler generates DWARF, so the unwinder
belongs to the compiler.

Thanks Florian Weimer and Carlos O'Donell for their help on
investigating this issue.

4 years agobpo-44466: Faulthandler now detects the GC (GH-26823)
Victor Stinner [Mon, 21 Jun 2021 11:15:40 +0000 (13:15 +0200)] 
bpo-44466: Faulthandler now detects the GC (GH-26823)

The faulthandler module now detects if a fatal error occurs during a
garbage collector collection (only if all_threads is true).

4 years agobpo-44337: Improve LOAD_ATTR specialization (GH-26759)
Mark Shannon [Mon, 21 Jun 2021 10:49:21 +0000 (11:49 +0100)] 
bpo-44337: Improve LOAD_ATTR specialization (GH-26759)

* Specialize obj.__class__ with LOAD_ATTR_SLOT

* Specialize instance attribute lookup with attribute on class, provided attribute on class is not an overriding descriptor.

* Add stat for how many times the unquickened instruction has executed.

4 years agobpo-44297: Fix missing line number in generator expressions (GH-26801)
Mark Shannon [Mon, 21 Jun 2021 09:55:15 +0000 (10:55 +0100)] 
bpo-44297: Fix missing line number in generator expressions (GH-26801)

* Make sure that line number is set when entering comprehension scope in compiler.

4 years agobpo-44469: Fix tests for "async with" with bad object (GH-26817)
Serhiy Storchaka [Mon, 21 Jun 2021 07:21:59 +0000 (10:21 +0300)] 
bpo-44469: Fix tests for "async with" with bad object (GH-26817)

Test for execution of the body was null. It would pass
even if the code which should be skipped was executed.

4 years agobpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)
Georg Sauthoff [Sun, 20 Jun 2021 20:08:07 +0000 (22:08 +0200)] 
bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
4 years agoFix typos and grammatical changes in the 3.10 what's new document (GH-26319)
Hemangii [Sun, 20 Jun 2021 19:46:59 +0000 (01:16 +0530)] 
Fix typos and grammatical changes in the 3.10 what's new document (GH-26319)

4 years agobpo-44430: Refactor `sqlite3` threading tests (GH-26748)
Erlend Egeberg Aasland [Sun, 20 Jun 2021 19:26:36 +0000 (21:26 +0200)] 
bpo-44430: Refactor `sqlite3` threading tests (GH-26748)

1. Rewrite ThreadTests with a _run_test() helper method that does the heavy lifting
2. Add test.support.threading_helper.reap_threads to _run_test()
3. Use _run_test() in all threading tests
4. Add test case for sqlite3.Connection.set_trace_callback
5. Add test case for sqlite3.Connection.create_collation

4 years agobpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567)
Erlend Egeberg Aasland [Sun, 20 Jun 2021 19:24:32 +0000 (21:24 +0200)] 
bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567)

4 years agobpo-40956: Convert sqlite3.connect and sqlite3.Connection.__init__ to AC (GH-24421)
Erlend Egeberg Aasland [Sun, 20 Jun 2021 19:24:00 +0000 (21:24 +0200)] 
bpo-40956: Convert sqlite3.connect and sqlite3.Connection.__init__ to AC (GH-24421)

4 years agobpo-38291: DeprecationWarning when importing typing.{io,re} (#26719)
Sebastian Rittau [Sat, 19 Jun 2021 17:31:18 +0000 (19:31 +0200)] 
bpo-38291: DeprecationWarning when importing typing.{io,re} (#26719)

4 years agobpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798)
Mark Dickinson [Sat, 19 Jun 2021 14:32:24 +0000 (15:32 +0100)] 
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798)

4 years agobpo-43298: Improved error message when building without the Windows SDK installed...
Steve Dower [Sat, 19 Jun 2021 12:45:16 +0000 (13:45 +0100)] 
bpo-43298: Improved error message when building without the Windows SDK installed (GH-26800)

4 years agobpo-38820: Test with OpenSSL 3.0.0-beta1 (GH-26769)
Christian Heimes [Sat, 19 Jun 2021 09:08:41 +0000 (11:08 +0200)] 
bpo-38820: Test with OpenSSL 3.0.0-beta1 (GH-26769)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agoRemove dubious suggestion (GH-26789)
Raymond Hettinger [Sat, 19 Jun 2021 00:19:32 +0000 (19:19 -0500)] 
Remove dubious suggestion (GH-26789)

Remove the weakref example.  If a new instance is created and the same arguments are passes, it raises a ReferenceError.

4 years agoAdd a note about NameError/AttributeError suggestions with custom error functions...
Pablo Galindo [Fri, 18 Jun 2021 22:08:38 +0000 (23:08 +0100)] 
Add a note about NameError/AttributeError suggestions with custom error functions (GH-26794)

4 years agobpo-43945: [Enum] reduce scope of new format() behavior (GH-26752)
Ethan Furman [Fri, 18 Jun 2021 20:15:46 +0000 (13:15 -0700)] 
bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752)

* [Enum] reduce scope of new format behavior

Instead of treating all Enums the same for format(), only user mixed-in
enums will be affected.  In other words, IntEnum and IntFlag will not be
changing the format() behavior, due to the requirement that they be
drop-in replacements of existing integer constants.

If a user creates their own integer-based enum, then the new behavior
will apply:

    class Grades(int, Enum):
        A = 5
        B = 4
        C = 3
        D = 2
        F = 0

Now:  format(Grades.B)  -> DeprecationWarning and '4'
3.12:                   -> no warning, and 'B'

4 years agobpo-44451: Reset DeprecationWarning filters in test_importlib.test_entry_points_by_in...
Miro Hrončok [Fri, 18 Jun 2021 20:02:45 +0000 (22:02 +0200)] 
bpo-44451: Reset DeprecationWarning filters in test_importlib.test_entry_points_by_index (GH-26784)

This avoids the following error if DeprecationWarnings are ignored.

    ======================================================================
    ERROR: test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests)
    Prior versions of Distribution.entry_points would return a
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/builddir/build/BUILD/Python-3.10.0b3/Lib/test/test_importlib/test_metadata_api.py", line 145, in test_entry_points_by_index
        expected = next(iter(caught))
    StopIteration
    ----------------------------------------------------------------------
    Ran 1402 tests in 2.125s
    FAILED (errors=1, skipped=18, expected failures=1)

4 years agoReorganize the pattern matching suite (GH-26661)
Brandt Bucher [Fri, 18 Jun 2021 17:18:14 +0000 (10:18 -0700)] 
Reorganize the pattern matching suite (GH-26661)

4 years agobpo-44032: Move pointer to code object from frame-object to frame specials array...
Mark Shannon [Fri, 18 Jun 2021 10:00:29 +0000 (11:00 +0100)] 
bpo-44032: Move pointer to code object from frame-object to frame specials array. (GH-26771)

4 years agobpo-44310: Add a FAQ entry for caching method calls (GH-26731)
Raymond Hettinger [Thu, 17 Jun 2021 20:39:42 +0000 (15:39 -0500)] 
bpo-44310: Add a FAQ entry for caching method calls (GH-26731)

4 years agobpo-43024: improve signature (in help, etc) for functions taking sent… (GH-24331)
Irit Katriel [Thu, 17 Jun 2021 16:14:30 +0000 (17:14 +0100)] 
bpo-43024: improve signature (in help, etc) for functions taking sent… (GH-24331)

…inel defaults

4 years agoDo not clear globals or builtins when calling clear() on a frame object. Reverts...
Mark Shannon [Thu, 17 Jun 2021 15:29:15 +0000 (16:29 +0100)] 
Do not clear globals or builtins when calling clear() on a frame object. Reverts behavior to that of 3.10 and earlier. (GH-26768)

4 years agobpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351)
Erlend Egeberg Aasland [Thu, 17 Jun 2021 10:06:09 +0000 (12:06 +0200)] 
bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351)

* Make functools types immutable

* Multibyte codec types are now immutable

* pyexpat.xmlparser is now immutable

* array.arrayiterator is now immutable

* _thread types are now immutable

* _csv types are now immutable

* _queue.SimpleQueue is now immutable

* mmap.mmap is now immutable

* unicodedata.UCD is now immutable

* sqlite3 types are now immutable

* _lsprof.Profiler is now immutable

* _overlapped.Overlapped is now immutable

* _operator types are now immutable

* winapi__overlapped.Overlapped is now immutable

* _lzma types are now immutable

* _bz2 types are now immutable

* _dbm.dbm and _gdbm.gdbm are now immutable

4 years agobpo-44389: Fix typo in ssl deprecation warning message (GH-26754)
Joe [Thu, 17 Jun 2021 09:39:57 +0000 (17:39 +0800)] 
bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)

`ssl.SSL_NO_TLS` should be `ssl.OP_NO_TLS`.

4 years agobpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num...
Mark Dickinson [Wed, 16 Jun 2021 17:43:49 +0000 (18:43 +0100)] 
bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num'. (GH-26744)

4 years agobpo-44392: Add Py_GenericAlias to C API docs (GH-26724)
Ken Jin [Wed, 16 Jun 2021 14:12:25 +0000 (22:12 +0800)] 
bpo-44392: Add Py_GenericAlias to C API docs (GH-26724)

Also fix stable ABI type definitions

4 years agobpo-38211: Clean up type_init() (GH-16257)
Sergey Fedoseev [Wed, 16 Jun 2021 13:04:38 +0000 (18:04 +0500)] 
bpo-38211: Clean up type_init() (GH-16257)

1. Remove conditions already checked by assert()
2. Remove object_init() call that effectively creates an empty tuple and
checks that this tuple is empty

4 years agobpo-44422: threading.Thread reuses the _delete() method (GH-26741)
Victor Stinner [Wed, 16 Jun 2021 09:41:17 +0000 (11:41 +0200)] 
bpo-44422: threading.Thread reuses the _delete() method (GH-26741)

The _bootstrap_inner() method of threading.Thread now reuses its
_delete() method rather than accessing _active() directly. It became
possible since _active_limbo_lock became reentrant. Moreover, it no
longer ignores any exception when deleting the thread from the
_active dictionary.

4 years agobpo-43795: Don't list private names in the limited API (GH-26740)
Petr Viktorin [Wed, 16 Jun 2021 09:22:36 +0000 (11:22 +0200)] 
bpo-43795: Don't list private names in the limited API (GH-26740)

* Remove struct _node from the stable ABI list

This struct was removed along with the old parser in Python 3.9 (PEP 617)

* Stable ABI list: Use the public name "PyFrameObject" rather than "_frame"

* Ensure limited API doesn't contain private names

Names prefixed by an underscore are private by definition.

* Add a blurb

4 years agobpo-44342: [Enum] sync current docs to 3.10 (GH-26750)
Ethan Furman [Wed, 16 Jun 2021 01:51:19 +0000 (18:51 -0700)] 
bpo-44342: [Enum] sync current docs to 3.10 (GH-26750)

4 years agobpo-43693: Eliminate unused "fast locals". (gh-26587)
Eric Snow [Tue, 15 Jun 2021 22:35:25 +0000 (16:35 -0600)] 
bpo-43693: Eliminate unused "fast locals". (gh-26587)

Currently, if an arg value escapes (into the closure for an inner function) we end up allocating two indices in the fast locals even though only one gets used.  Additionally, using the lower index would be better in some cases, such as with no-arg `super()`.  To address this, we update the compiler to fix the offsets so each variable only gets one "fast local".  As a consequence, now some cell offsets are interspersed with the locals (only when an arg escapes to an inner function).

https://bugs.python.org/issue43693

4 years agobpo-43475: Add what's new entry for NaN hash changes (GH-26725)
Mark Dickinson [Tue, 15 Jun 2021 18:48:35 +0000 (19:48 +0100)] 
bpo-43475: Add what's new entry for NaN hash changes (GH-26725)

4 years ago[Enum] improve test, add andrei kulakov to ACKS (GH-26726)
Ethan Furman [Tue, 15 Jun 2021 18:38:15 +0000 (11:38 -0700)] 
[Enum] improve test, add andrei kulakov to ACKS (GH-26726)

4 years agobpo-44422: Fix threading.enumerate() reentrant call (GH-26727)
Victor Stinner [Tue, 15 Jun 2021 14:14:24 +0000 (16:14 +0200)] 
bpo-44422: Fix threading.enumerate() reentrant call (GH-26727)

The threading.enumerate() function now uses a reentrant lock to
prevent a hang on reentrant call.

4 years agobpo-42972: _thread.RLock implements the GH protocol (GH-26734)
Victor Stinner [Tue, 15 Jun 2021 13:09:24 +0000 (15:09 +0200)] 
bpo-42972: _thread.RLock implements the GH protocol (GH-26734)

The _thread.RLock type now fully implement the GC protocol: add a
traverse function and the Py_TPFLAGS_HAVE_GC flag.

4 years agobpo-42064: Move sqlite3 types to global state (GH-26537)
Erlend Egeberg Aasland [Tue, 15 Jun 2021 12:47:34 +0000 (14:47 +0200)] 
bpo-42064: Move sqlite3 types to global state (GH-26537)

* Move connection type to global state
* Move cursor type to global state
* Move prepare protocol type to global state
* Move row type to global state
* Move statement type to global state
* ADD_TYPE takes a pointer
* pysqlite_get_state is now static inline

4 years agoAdd extra stats for attribute misses (GH-26732)
Mark Shannon [Tue, 15 Jun 2021 12:01:42 +0000 (13:01 +0100)] 
Add extra stats for attribute misses (GH-26732)

4 years agoFix a typo in _make_class_unpicklable() docstring (GH-26729)
andrei kulakov [Tue, 15 Jun 2021 02:42:46 +0000 (22:42 -0400)] 
Fix a typo in _make_class_unpicklable() docstring (GH-26729)

4 years agobpo-44409: Fix error location in tokenizer errors that happen during initialization...
Pablo Galindo [Mon, 14 Jun 2021 16:46:11 +0000 (17:46 +0100)] 
bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712)

4 years agoFix typo in lnotab_notes.txt (GH-26711)
Gabriele N. Tornetta [Mon, 14 Jun 2021 14:49:05 +0000 (15:49 +0100)] 
Fix typo in lnotab_notes.txt (GH-26711)

Thanks for your contribution @P403n1x87

4 years agobpo-38291: Remove mention of typing.io and typing.re again (GH-26113)
Sebastian Rittau [Mon, 14 Jun 2021 14:45:19 +0000 (16:45 +0200)] 
bpo-38291: Remove mention of typing.io and typing.re again (GH-26113)

They were originally removed in GH-10173 per bpo-35089, but then
readded in GH-21574. Cf. bpo-38291 for decision to remove.

4 years agoRemove accidentally duplicated STAT_INC (GH-26718)
Mark Shannon [Mon, 14 Jun 2021 12:38:16 +0000 (13:38 +0100)] 
Remove accidentally duplicated STAT_INC (GH-26718)

4 years agobpo-44338: Port LOAD_GLOBAL to PEP 659 adaptive interpreter (GH-26638)
Mark Shannon [Mon, 14 Jun 2021 10:04:09 +0000 (11:04 +0100)] 
bpo-44338: Port LOAD_GLOBAL to PEP 659 adaptive interpreter (GH-26638)

* Add specializations of LOAD_GLOBAL.

* Add more stats.

* Remove old opcache; it is no longer used.

* Add NEWS

4 years agobpo-44310: Note that lru_cache keep references to both arguments and results (GH...
Raymond Hettinger [Mon, 14 Jun 2021 05:47:26 +0000 (00:47 -0500)] 
bpo-44310:  Note that lru_cache keep references to both arguments and results (GH-26715)

* Simplify the count_vowels example
* Hits and misses are fetched while a lock is held
* Add note that references are kept for arguments and return values
* Clarify behavior when *typed* is false.

4 years agobpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700)
Christian Heimes [Sun, 13 Jun 2021 11:46:07 +0000 (13:46 +0200)] 
bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agoFix a potential reference-counting bug in long_pow (GH-26690)
Mark Dickinson [Sun, 13 Jun 2021 07:19:29 +0000 (08:19 +0100)] 
Fix a potential reference-counting bug in long_pow (GH-26690)

4 years agoFix typos in multiple files (GH-26689)
Binbin [Sun, 13 Jun 2021 02:47:44 +0000 (10:47 +0800)] 
Fix typos in multiple files (GH-26689)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agobpo-43425: Update test_c_parser not to use TempdirManager (GH-26693)
Dong-hee Na [Sat, 12 Jun 2021 22:07:24 +0000 (07:07 +0900)] 
bpo-43425: Update test_c_parser not to use TempdirManager (GH-26693)

4 years agobpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680)
Erlend Egeberg Aasland [Sat, 12 Jun 2021 20:17:58 +0000 (22:17 +0200)] 
bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680)

4 years agobpo-44396: Update multi-line-start location when reallocating tokenizer buffers ...
Pablo Galindo [Sat, 12 Jun 2021 17:53:49 +0000 (18:53 +0100)] 
bpo-44396: Update multi-line-start location when reallocating tokenizer buffers (GH-26676)

Automerge-Triggered-By: GH:pablogsal
4 years agobpo-44376 - reduce pow() overhead for small exponents (GH-26662)
Tim Peters [Sat, 12 Jun 2021 16:29:56 +0000 (11:29 -0500)] 
bpo-44376 - reduce pow() overhead for small exponents (GH-26662)

Greatly reduce pow() overhead for small exponents.

4 years agoAdd more const modifiers. (GH-26691)
Serhiy Storchaka [Sat, 12 Jun 2021 13:11:59 +0000 (16:11 +0300)] 
Add more const modifiers. (GH-26691)

4 years agobpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679)
Serhiy Storchaka [Sat, 12 Jun 2021 12:15:17 +0000 (15:15 +0300)] 
bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679)

4 years agobpo-44339: Fix math.pow corner case to comply with IEEE 754 (GH-26606)
Mark Dickinson [Sat, 12 Jun 2021 09:23:02 +0000 (10:23 +0100)] 
bpo-44339: Fix math.pow corner case to comply with IEEE 754 (GH-26606)

Change the behaviour of `math.pow(0.0, -math.inf)` and `math.pow(-0.0, -math.inf)` to return positive infinity instead of raising `ValueError`. This makes `math.pow` consistent with the built-in `pow` (and the `**` operator) for this particular special case, and brings the `math.pow` special-case handling into compliance with IEEE 754.

4 years agobpo-40128: Fix IDLE autocomplete on macOS (GH-26672)
Kaustubh J [Fri, 11 Jun 2021 22:55:32 +0000 (04:25 +0530)] 
bpo-40128: Fix IDLE autocomplete on macOS (GH-26672)

In particular, when running with tk8.6.8, as in PSF 3.9.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agobpo-44381: Windows build now allows enabling control flow guard (GH-26645)
Steve Dower [Fri, 11 Jun 2021 20:35:40 +0000 (21:35 +0100)] 
bpo-44381: Windows build now allows enabling control flow guard (GH-26645)

4 years agobpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646)
huzhaojie [Fri, 11 Jun 2021 15:17:56 +0000 (23:17 +0800)] 
bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646)

4 years agobpo-44351: Restore back parse_makefile in distutils.sysconfig (GH-26637)
Lumír 'Frenzy' Balhar [Fri, 11 Jun 2021 15:08:00 +0000 (17:08 +0200)] 
bpo-44351: Restore back parse_makefile in distutils.sysconfig (GH-26637)

The function uses distutils.text_file.TextFile and therefore
behaves differently than _parse_makefile in sysconfig.

4 years agobpo-44242: [Enum] improve error messages (GH-26669)
Ethan Furman [Fri, 11 Jun 2021 09:44:43 +0000 (02:44 -0700)] 
bpo-44242: [Enum] improve error messages (GH-26669)

4 years agobpo-44378: Fix a compiler warning in Py_IS_TYPE() (GH-26644)
Victor Stinner [Fri, 11 Jun 2021 08:35:36 +0000 (10:35 +0200)] 
bpo-44378: Fix a compiler warning in Py_IS_TYPE() (GH-26644)

Py_IS_TYPE() no longer uses Py_TYPE() to avoid a compiler warning:
no longer cast "const PyObject*" to "PyObject*".

4 years agobpo-44342: [Enum] fix data type search (GH-26667)
Ethan Furman [Fri, 11 Jun 2021 08:25:14 +0000 (01:25 -0700)] 
bpo-44342: [Enum] fix data type search (GH-26667)

In an inheritance chain of

  int -> my_int -> final_int

the data type is now final_int (not my_int)

4 years agobpo-44362: ssl: improve deprecation warnings and docs (GH-26646)
Christian Heimes [Fri, 11 Jun 2021 07:15:48 +0000 (09:15 +0200)] 
bpo-44362: ssl: improve deprecation warnings and docs (GH-26646)

Signed-off-by: Christian Heimes <christian@python.org>
4 years agoDoc: Prettier exception hierarchy. (GH-26533)
Julien Palard [Fri, 11 Jun 2021 06:53:52 +0000 (08:53 +0200)] 
Doc: Prettier exception hierarchy. (GH-26533)

4 years agobpo-44342: [Enum] changed pickling from by-value to by-name (GH-26658)
Ethan Furman [Thu, 10 Jun 2021 22:52:09 +0000 (15:52 -0700)] 
bpo-44342: [Enum] changed pickling from by-value to by-name (GH-26658)

by-value lookups could fail on complex enums, necessitating a check for
__reduce__ and possibly sabotaging the final enum;

by-name lookups should never fail, and sabotaging is no longer necessary
for class-based enum creation.

4 years agobpo-44368: Improve syntax errors with invalid as pattern targets (GH-26632)
Pablo Galindo [Thu, 10 Jun 2021 22:50:32 +0000 (23:50 +0100)] 
bpo-44368: Improve syntax errors with invalid as pattern targets (GH-26632)

4 years agobpo-44385: Remove unused grammar rules (GH-26655)
Lysandros Nikolaou [Thu, 10 Jun 2021 22:05:06 +0000 (00:05 +0200)] 
bpo-44385: Remove unused grammar rules (GH-26655)

Automerge-Triggered-By: GH:lysnikolaou
4 years agobpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr ...
Daniel Hahler [Thu, 10 Jun 2021 20:32:04 +0000 (22:32 +0200)] 
bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr (GH-18180)

4 years agobpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649)
Ethan Furman [Thu, 10 Jun 2021 20:30:41 +0000 (13:30 -0700)] 
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649)

This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum:

    class Str1Enum(str, Enum):
        # some behavior here

    class Str2Enum(str, Enum):
        # some more behavior here

    class FinalStrEnum(Str1Enum, Str2Enum):
        # this now works

4 years agobpo-33962: Use ttk spinbox for IDLE indent space config (GH-22954)
Mark Roseman [Thu, 10 Jun 2021 19:13:55 +0000 (12:13 -0700)] 
bpo-33962: Use ttk spinbox for IDLE indent space config (GH-22954)

If ttk.Spinbox is not available (Tk < 8.5.9) use readonly ttk.Combobox.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
4 years agoRun address sanitiser in the GitHub CI (GH-26640)
Pablo Galindo [Thu, 10 Jun 2021 17:47:53 +0000 (18:47 +0100)] 
Run address sanitiser in the GitHub CI (GH-26640)

4 years agobpo-44357:Add `math.cbrt()` function: Cube Root (GH-26622)
Ajith Ramachandran [Thu, 10 Jun 2021 16:42:09 +0000 (22:12 +0530)] 
bpo-44357:Add `math.cbrt()` function: Cube Root (GH-26622)

* Add math.cbrt() function: Cube Root

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
4 years agobpo-44364:Add non integral tests for `sqrt()` (#26625)
Ajith Ramachandran [Thu, 10 Jun 2021 16:27:26 +0000 (21:57 +0530)] 
bpo-44364:Add non integral tests for `sqrt()` (#26625)

* Add non integral tests for `sqrt()`

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
4 years agobpo-44363: Get test_capi passing with address sanitizer (GH-26639)
Mark Shannon [Thu, 10 Jun 2021 11:37:22 +0000 (12:37 +0100)] 
bpo-44363: Get test_capi passing with address sanitizer (GH-26639)