Commit Graph

110259 Commits

Author SHA1 Message Date
Guido van Rossum 355f5dd36a
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.
2021-06-21 13:53:04 -07:00
Ken Jin c5d700f0e2
Reset DeprecationWarning filters in test_typing io and re (#26811) 2021-06-21 11:17:55 -07:00
Pablo Galindo 06cda808f1
bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822) 2021-06-21 16:23:53 +01:00
Dong-hee Na 30f7a77f35
bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685) 2021-06-21 22:59:02 +09:00
Victor Stinner 45a78f906d
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.
2021-06-21 13:16:18 +02:00
Victor Stinner d19163912b
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).
2021-06-21 13:15:40 +02:00
Mark Shannon fb68791a26
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.
2021-06-21 11:49:21 +01:00
Mark Shannon 82e5c28af7
bpo-44297: Fix missing line number in generator expressions (GH-26801)
* Make sure that line number is set when entering comprehension scope in compiler.
2021-06-21 10:55:15 +01:00
Serhiy Storchaka 5d2b3a0d68
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.
2021-06-21 10:21:59 +03:00
Georg Sauthoff a317778fd5
bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-06-20 21:08:07 +01:00
Hemangii 7265b277fa
Fix typos and grammatical changes in the 3.10 what's new document (GH-26319) 2021-06-20 20:46:59 +01:00
Erlend Egeberg Aasland 5f0fc30de4
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
2021-06-20 20:26:36 +01:00
Erlend Egeberg Aasland 7d0a47e1af
bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) 2021-06-20 20:24:32 +01:00
Erlend Egeberg Aasland 185ecdc146
bpo-40956: Convert sqlite3.connect and sqlite3.Connection.__init__ to AC (GH-24421) 2021-06-20 20:24:00 +01:00
Sebastian Rittau 09eb817115
bpo-38291: DeprecationWarning when importing typing.{io,re} (#26719) 2021-06-19 10:31:18 -07:00
Mark Dickinson 291848195f
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) 2021-06-19 15:32:24 +01:00
Steve Dower 80190b3e53
bpo-43298: Improved error message when building without the Windows SDK installed (GH-26800) 2021-06-19 13:45:16 +01:00
Christian Heimes 44fb551499
bpo-38820: Test with OpenSSL 3.0.0-beta1 (GH-26769)
Signed-off-by: Christian Heimes <christian@python.org>
2021-06-19 11:08:41 +02:00
Raymond Hettinger e5c7ee1156
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.
2021-06-18 19:19:32 -05:00
Pablo Galindo 83c9dad8da
Add a note about NameError/AttributeError suggestions with custom error functions (GH-26794) 2021-06-18 23:08:38 +01:00
Ethan Furman f60b07ab6c
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'
2021-06-18 13:15:46 -07:00
Miro Hrončok df1502e47f
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)
2021-06-18 16:02:45 -04:00
Brandt Bucher c106cf31f8
Reorganize the pattern matching suite (GH-26661) 2021-06-18 10:18:14 -07:00
Mark Shannon 0982ded179
bpo-44032: Move pointer to code object from frame-object to frame specials array. (GH-26771) 2021-06-18 11:00:29 +01:00
Raymond Hettinger 7f01f77f8f
bpo-44310: Add a FAQ entry for caching method calls (GH-26731) 2021-06-17 15:39:42 -05:00
Irit Katriel f73377d57c
bpo-43024: improve signature (in help, etc) for functions taking sent… (GH-24331)
…inel defaults
2021-06-17 09:14:30 -07:00
Mark Shannon ba2f32a983
Do not clear globals or builtins when calling clear() on a frame object. Reverts behavior to that of 3.10 and earlier. (GH-26768) 2021-06-17 16:29:15 +01:00
Erlend Egeberg Aasland 00710e6346
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
2021-06-17 11:06:09 +01:00
Joe c544393b89
bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)
`ssl.SSL_NO_TLS` should be `ssl.OP_NO_TLS`.
2021-06-17 02:39:57 -07:00
Mark Dickinson 7247f6f433
bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num'. (GH-26744) 2021-06-16 18:43:49 +01:00
Ken Jin 6773c3eaa7
bpo-44392: Add Py_GenericAlias to C API docs (GH-26724)
Also fix stable ABI type definitions
2021-06-16 07:12:25 -07:00
Sergey Fedoseev ab030d6f9d
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
2021-06-16 14:04:38 +01:00
Victor Stinner 0729694246
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.
2021-06-16 11:41:17 +02:00
Petr Viktorin 7cad9cb51b
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
2021-06-16 11:22:36 +02:00
Ethan Furman 741b8ae1cf
bpo-44342: [Enum] sync current docs to 3.10 (GH-26750) 2021-06-15 18:51:19 -07:00
Eric Snow ac38a9f2df
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
2021-06-15 16:35:25 -06:00
Mark Dickinson 1d10bf0bb9
bpo-43475: Add what's new entry for NaN hash changes (GH-26725) 2021-06-15 19:48:35 +01:00
Ethan Furman cb2014f207
[Enum] improve test, add andrei kulakov to ACKS (GH-26726) 2021-06-15 11:38:15 -07:00
Victor Stinner 243fd01047
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.
2021-06-15 16:14:24 +02:00
Victor Stinner 1cd3d859a4
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.
2021-06-15 15:09:24 +02:00
Erlend Egeberg Aasland 10a5c806d4
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
2021-06-15 14:47:34 +02:00
Mark Shannon 8ebd9447e9
Add extra stats for attribute misses (GH-26732) 2021-06-15 13:01:42 +01:00
andrei kulakov 689a84475e
Fix a typo in _make_class_unpicklable() docstring (GH-26729) 2021-06-14 19:42:46 -07:00
Pablo Galindo 507ed6fa1d
bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712) 2021-06-14 17:46:11 +01:00
Gabriele N. Tornetta cc8ecf6864
Fix typo in lnotab_notes.txt (GH-26711)
Thanks for your contribution @P403n1x87
2021-06-14 11:49:05 -03:00
Sebastian Rittau 8a76683cfb
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.
2021-06-14 07:45:19 -07:00
Mark Shannon 358aa6197c
Remove accidentally duplicated STAT_INC (GH-26718) 2021-06-14 13:38:16 +01:00
Mark Shannon eecbc7c390
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
2021-06-14 11:04:09 +01:00
Raymond Hettinger fafcfff926
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.
2021-06-14 00:47:26 -05:00
Christian Heimes bf527277d4
bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700)
Signed-off-by: Christian Heimes <christian@python.org>
2021-06-13 13:46:07 +02:00