summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-116664: In _warnings.c, make filters_version access thread-safe (#117374)Erlend E. Aasland2024-03-291-6/+9
| | | | - assert that the lock is held in already_warned() - protect 'filters_version' increment in warnings_filters_mutated_impl()
* gh-117348: Refactored RawConfigParser._read for similicity and ↵Jason R. Coombs2024-03-292-147/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | comprehensibility (#117372) * Extract method for _read_inner, reducing complexity and indentation by 1. * Extract method for _raise_all and yield ParseErrors from _read_inner. Reduces complexity by 1 and reduces touch points for handling errors in _read_inner. * Prefer iterators to splat expansion and literal indexing. * Extract method for _strip_comments. Reduces complexity by 7. * Model the file lines in a class to encapsulate the comment status and cleaned value. * Encapsulate the read state as a dataclass * Extract _handle_continuation_line and _handle_rest methods. Reduces complexity by 8. * Reindent * At least for now, collect errors in the ReadState * Check for missing section header separately. * Extract methods for _handle_header and _handle_option. Reduces complexity by 6. * Remove unreachable code. Reduces complexity by 4. * Remove unreachable branch * Handle error condition early. Reduces complexity by 1. * Add blurb * Move _raise_all to ParsingError, as its behavior is most closely related to the exception class and not the reader. * Split _strip* into separate methods. * Refactor _strip_full to compute the strip just once and use 'not any' to determine the factor. * Replace use of 'sys.maxsize' with direct computation of the stripped value. * Extract has_comments as a dynamic property. * Implement clean as a cached property. * Model comment prefixes in the RawConfigParser within a prefixes namespace. * Use a regular expression to search for the first match. Avoids mutating variables and tricky logic and over-computing all of the starts when only the first is relevant.
* gh-117300: Use stop the world to make `sys._current_frames` and ↵Sam Gross2024-03-292-1/+6
| | | | | | | | | | `sys._current_exceptions` thread-safe. (#117301) This adds a stop the world pause to make the two functions thread-safe when the GIL is disabled in the free-threaded build. Additionally, the main test thread may call `sys._current_exceptions()` as soon as `g_raised.set()` is called. The background thread may not yet reach the `leave_g.wait()` line.
* Fix broken format in error for bad input in summarize_stats.py (#117375)Guido van Rossum2024-03-291-1/+1
| | | When you pass the script a non-existent input file, you get a TypeError instead of the intended ValueError.
* gh-111926: Avoid locking in PyType_IsSubtype (#117275)mpage2024-03-291-8/+1
| | | | | | | | | | | | | Read the MRO in a thread-unsafe way in `PyType_IsSubtype` to avoid locking. Fixing this is tracked in #117306. The motivation for this change is in support of making weakrefs thread-safe in free-threaded builds: `WeakValueDictionary` uses a special dictionary function, `_PyDict_DelItemIf` to remove dead weakrefs from the dictionary. `_PyDict_DelItemIf` removes a key if a user supplied predicate evaluates to true for the value associated with the key. Crucially for the `WeakValueDictionary` use case, the predicate evaluation + deletion sequence is atomic, provided that the predicate doesn’t suspend. The predicate used by `WeakValueDictionary` includes a subtype check, which we must ensure doesn't suspend in free-threaded builds.
* gh-117323: Make `cell` thread-safe in free-threaded builds (#117330)Sam Gross2024-03-2911-43/+83
| | | Use critical sections to lock around accesses to cell contents. The critical sections are no-ops in the default (with GIL) build.
* gh-117344: Skip flaky tests in free-threaded build (#117355)Sam Gross2024-03-292-0/+2
| | | | | The tests are not reliable with the GIL disabled. In theory, they can fail with the GIL enabled too, but the failures are much more likely with the GIL disabled.
* gh-112529: Don't untrack tuples or dicts with zero refcount (#117370)Sam Gross2024-03-291-15/+18
| | | | | | | | The free-threaded GC sometimes sees objects with zero refcount. This can happen due to the delay in merging biased reference counting fields, and, in the future, due to deferred reference counting. We should not untrack these objects or they will never be collected. This fixes the refleaks in the free-threaded build.
* gh-116664: Fix unused var warnings in _warnings.c in non-free-threaded ↵Erlend E. Aasland2024-03-291-0/+8
| | | | | builds (#117373) The warnings were introduced by commit c1712ef06.
* Refactor pdb executable targets (#112570)Tian Gao2024-03-291-41/+36
| | | Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* gh-66449: configparser: Add support for unnamed sections (#117273)Pedro Lacerda2024-03-295-31/+172
| | | Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* gh-117166: Ignore empty and temporary dirs in `test_makefile` (#117190)Nikita Sobolev2024-03-291-2/+10
|
* gh-117347: Fix test_clinic side effects (#117363)Victor Stinner2024-03-291-0/+18
| | | | Save/restore converters in ClinicWholeFileTest and ClinicExternalTest.
* gh-117142: ctypes: Migrate global vars to module state (GH-117189)neonene2024-03-297-224/+237
|
* Fix reversed assertRegex checks in test_ssl. (#117351)Gregory P. Smith2024-03-291-2/+2
|
* gh-117110: Fix subclasses of typing.Any with custom constructors (#117111)傅立业(Chris Fu)2024-03-293-1/+22
|
* gh-117339: Use NULL instead of None for LOAD_SUPER_ATTR in dis docs (GH-117343)Christopher Chianelli2024-03-281-1/+1
|
* GH-117121: Add pystats to JIT builds (GH-117346)Michael Droettboom2024-03-283-1/+10
|
* gh-117335: Handle non-iterables for `ntpath.commonpath` (GH-117336)Nice Zombies2024-03-283-6/+9
|
* Increase the JIT CI timeouts to 75 minutes (GH-117342)Brandt Bucher2024-03-281-7/+5
|
* gh-117294: Report DocTestCase as skipped if all examples in the doctest are ↵Malcolm Smith2024-03-287-7/+87
| | | | skipped (GH-117297)
* gh-69201: Separate stdout and stderr stream in test_pdb (#117308)Tian Gao2024-03-281-16/+17
|
* gh-114331: Skip decimal test_maxcontext_exact_arith on s390x (#117326)Victor Stinner2024-03-281-1/+5
|
* gh-116664: Make module state Py_SETREF's in _warnings thread-safe (#116959)Erlend E. Aasland2024-03-283-23/+44
| | | | | | Mark the swap operations as critical sections. Add an internal Py_BEGIN_CRITICAL_SECTION_MUT API that takes a PyMutex pointer instead of a PyObject pointer.
* bpo-43848: explain optional argument mtime in gzip.py. (GH-25410)Joachim Wuttke2024-03-283-16/+17
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-110481: Fix biased reference counting queue initialization. (#117271)Sam Gross2024-03-282-6/+18
| | | | | The biased reference counting queue must be initialized from the bound (active) thread because it uses `_Py_ThreadId()` as the key in a hash table.
* gh-117178: Recover lazy loading of self-referential modules (#117179)Chris Markiewicz2024-03-283-6/+25
|
* gh-117266: Fix crashes on user-created AST subclasses (GH-117276)Jelle Zijlstra2024-03-284-4/+69
| | | Fix crashes on user-created AST subclasses
* gh-117310: Remove extra DECREF on "no ciphers" error path in ↵Gregory P. Smith2024-03-282-1/+4
| | | | | | | | | | `_ssl._SSLContext` constructor (#117309) Remove extra self DECREF on ssl "no ciphers" error path. This doesn't come up in practice because nobody links against a broken OpenSSL library that provides nothing.
* gh-116303: Handle disabled test modules in test.support helpers (#116482)Erlend E. Aasland2024-03-283-8/+27
| | | | Make sure test.support helpers skip iso. failing if test extension modules are disabled. Also log TEST_MODULES in test.pythoninfo.
* gh-114099: Add documentation for iOS platform (GH-117057)Russell Keith-Magee2024-03-2825-161/+584
| | | | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Jacob Coffee <jacob@z7x.org> Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Ned Deily <nad@python.org>
* gh-114099: Additions to standard library to support iOS (GH-117052)Russell Keith-Magee2024-03-2822-48/+474
| | | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Malcolm Smith <smith@chaquo.com> Co-authored-by: Ned Deily <nad@python.org>
* gh-89739: gh-77140: Support zip64 in zipimport (GH-94146)Tim Hatch2024-03-286-39/+154
| | | | | | | | | | | | | | | * Reads zip64 files as produced by the zipfile module * Include tests (somewhat slow, however, because of the need to create "large" zips) * About the same amount of strictness reading invalid zip files as zipfile has * Still works on files with prepended data (like pex) There are a lot more test cases at https://github.com/thatch/zipimport64/ that give me confidence that this works for real-world files. Fixes #89739 and #77140. --------- Co-authored-by: Itamar Ostricher <itamarost@gmail.com> Reviewed-by: Gregory P. Smith <greg@krypto.org>
* Revert "gh-116886: Temporarily disable CIfuzz (memory) (GH-117018)" (GH-117289)Illia Volochii2024-03-281-2/+1
| | | | | | | This reverts commit 1ab0d0b1167d78bf19661a3b5e533a2b68a57604. This reverts #117018. I expect the issue to be fixed based on https://github.com/google/oss-fuzz/pull/11708#issuecomment-2006442396 and https://github.com/actions/runner-images/issues/9491.
* gh-108277: Make test_os tolerate 10 ms diff for timerfd on Android emulators ↵Malcolm Smith2024-03-271-13/+20
| | | | (#117223)
* gh-113317: Change how Argument Clinic lists converters (#116853)Victor Stinner2024-03-272-32/+55
| | | | | | | | | | * Add a new create_parser_namespace() function for PythonParser to pass objects to executed code. * In run_clinic(), list converters using 'converters' and 'return_converters' dictionarties. * test_clinic: add 'object()' return converter. * Use also create_parser_namespace() in eval_ast_expr(). Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-99108: Update and check HACL* version information (GH-117295)Seth Michael Larson2024-03-272-4/+18
| | | * Update and check HACL* version information
* gh-117288: Allocate fewer label IDs in _PyCfg_ToInstructionSequence (#117290)Irit Katriel2024-03-274-6/+37
|
* gh-71042: Add `platform.android_ver` (#116674)Malcolm Smith2024-03-279-16/+164
|
* gh-117225: doctest: only print "and X failed" when non-zero, don't pluralise ↵Hugo van Kemenade2024-03-274-48/+69
| | | | "1 items" (#117228)
* Add statistics recipe for sampling from an estimated probability density ↵Raymond Hettinger2024-03-271-0/+58
| | | | distribution (#117221)
* gh-113548: Allow CLI arguments to `pdb -m` (#113557)Tian Gao2024-03-273-9/+25
|
* Change links on the index page (#117230)Adorilson Bezerra2024-03-261-2/+2
|
* gh-104242: Enable test_is_char_device_true in pathlib test on all platform ↵AN Long2024-03-261-5/+5
| | | | (GH-116983)
* gh-115775: Compiler adds __static_attributes__ field to classes (#115913)Irit Katriel2024-03-2613-11/+136
|
* gh-97901 add missing text/rtf to mimetypes (GH-97902)Antonio2024-03-263-0/+3
| | | | Co-authored-by: Noam Cohen <noam@noam.me>
* gh-115538: Use isolate mode when running venv ↵AN Long2024-03-261-1/+1
| | | | | test_multiprocessing_recursion() (#117116) Co-authored-by: Victor Stinner <vstinner@python.org>
* pre-commit: add `check-case-conflict` and `check-merge-conflict` (#117259)Hugo van Kemenade2024-03-261-1/+3
|
* gh-98966: Handle stdout=subprocess.STDOUT (GH-98967)Paulo Neves2024-03-263-0/+12
| | | | | | | Explicitly handle the case where stdout=STDOUT as otherwise the existing error handling gets confused and reports hard to understand errors. Signed-off-by: Paulo Neves <ptsneves@gmail.com>
* gh-66543: Fix mimetype.guess_type() (GH-117217)Serhiy Storchaka2024-03-264-9/+45
| | | | | | | | | | Fix parsing of the following corner cases: * URLs with only a host name * URLs containing a fragment * URLs containing a query * filenames with only a UNC sharepoint on Windows Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>