Jason R. Coombs
8af04cdef2
gh-97781: Apply changes from importlib_metadata 5. (GH-97785)
...
* gh-97781: Apply changes from importlib_metadata 5.
* Apply changes from upstream
* Apply changes from upstream.
2022-10-06 15:25:24 -04:00
Michael Droettboom
23e83a8465
gh-94808: Coverage: Test that maximum indentation level is handled ( #95926 )
...
* gh-94808: Coverage: Test that maximum indentation level is handled
* Use "compile" rather than "exec"
2022-10-06 10:39:17 -07:00
Kumar Aditya
e2e6b95c03
GH-88050: fix race in closing subprocess pipe in asyncio ( #97951 )
...
Check for None when iterating over `self._pipes.values()`.
2022-10-06 10:18:19 -07:00
Ned Deily
6d0a0191a4
gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK (GH-97944)
...
The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls.
Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a
segfault if cpython is built with the macOS 13 SDK but run on an earlier
version of macOS. Prevent this by adding runtime support for detection of
these system calls ("weaklinking") as is done for other newer syscalls on
macOS.
2022-10-06 09:11:47 -07:00
Nikita Sobolev
e63d7dae90
gh-94808: Cover PyUnicode_Count in CAPI ( #96929 )
2022-10-06 17:20:22 +02:00
Nikita Sobolev
e39ae6bef2
gh-94808: Cover PyObject_PyBytes case with custom __bytes__ method ( #96610 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-10-06 05:16:16 -07:00
Ethan Furman
b44372e03c
gh-96865: [Enum] fix Flag to use CONFORM boundary (GH-97528)
2022-10-05 15:25:55 -07:00
Brett Cannon
c206e53bb7
gh-65961: Raise DeprecationWarning when __package__ differs from __spec__.parent ( #97879 )
...
Also remove `importlib.util.set_package()` which was already slated for removal.
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2022-10-05 15:00:45 -07:00
Barry Warsaw
5dc3599135
gh-97850: Remove all known instances of module_repr() ( #97876 )
...
Remove all known instances of module_repr()
2022-10-05 11:42:26 -07:00
Pieter Eendebak
aeb28f5130
gh-91539: improve performance of get_proxies_environment ( #91566 )
...
* improve performance of get_proxies_environment when there are many environment variables
* 📜 🤖 Added by blurb_it.
* fix case of short env name
* fix formatting
* fix whitespace
* whitespace
* Update Lib/urllib/request.py
Co-authored-by: Carl Meyer <carl@oddbird.net>
* Update Lib/urllib/request.py
Co-authored-by: Carl Meyer <carl@oddbird.net>
* Update Lib/urllib/request.py
Co-authored-by: Carl Meyer <carl@oddbird.net>
* Update Lib/urllib/request.py
Co-authored-by: Carl Meyer <carl@oddbird.net>
* whitespace
* Update Misc/NEWS.d/next/Library/2022-04-15-11-29-38.gh-issue-91539.7WgVuA.rst
Co-authored-by: Carl Meyer <carl@oddbird.net>
* Update Lib/urllib/request.py
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2022-10-05 10:57:52 -07:00
Kumar Aditya
7015e13797
gh-88050: Fix asyncio subprocess to kill process cleanly when process is blocked ( #32073 )
2022-10-05 10:15:31 -07:00
Oleg Iarygin
09aea94d29
gh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 ( #97896 )
...
This fixes the buildbots.
2022-10-05 07:31:43 -07:00
Serhiy Storchaka
77f0249308
gh-95196: Disable incorrect pickling of the C implemented classmethod descriptors (GH-96383)
2022-10-05 14:21:16 +03:00
Serhiy Storchaka
e3ef400be7
gh-74696: Pass root_dir to custom archivers which support it (GH-94251)
...
Co-authored-by: Éric <merwok@netwok.org>
2022-10-05 12:48:59 +03:00
Irit Katriel
c529b45122
gh-87092: bring compiler code closer to a preprocessing-opt-assembler organisation (GH-97644)
2022-10-05 08:52:35 +01:00
Guido van Rossum
8079bef56f
GH-96704: Add {Task,Handle}.get_context(), use it in call_exception_handler() ( #96756 )
...
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-04 23:49:10 -07:00
andrei kulakov
db64fb9bbe
gh-97825: fix AttributeError when calling subprocess.check_output(input=None) with encoding or errors args ( #97826 )
...
* fix AttributeError, add unit test
2022-10-04 17:47:49 -07:00
Mark Shannon
76449350b3
GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510)
2022-10-05 01:34:03 +01:00
Brandt Bucher
0ff8fd6583
GH-97779: Ensure that *all* frame objects are backed by "complete" frames (GH-97845)
2022-10-04 17:30:03 -07:00
Nikita Sobolev
c3648f4e4a
gh-97837: Change deprecation warning message in unittest ( #97838 )
2022-10-04 17:29:18 -07:00
Ev2geny
743453a554
gh-58451: Add optional delete_on_close parameter to NamedTemporaryFile (GH-97015)
2022-10-04 23:37:33 +01:00
Łukasz Langa
bbc7cd649a
gh-97008: Add a Python implementation of AttributeError and NameError suggestions ( #97022 )
...
Relevant tests moved from test_exceptions to test_traceback to be able to
compare both implementations.
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2022-10-04 15:31:16 -07:00
Oleg Iarygin
ce8fc186ac
gh-93357: Start porting asyncio server test cases to IsolatedAsyncioTestCase ( #93369 )
...
Lay the foundation for further work in `asyncio.test_streams`.
2022-10-04 10:56:47 -07:00
Nikita Sobolev
4f380db1a5
gh-96142: add missing params to dataclass._DataclassParams (gh-96382)
2022-10-04 09:53:28 -07:00
Victor Stinner
116fa62c6e
gh-97670: Remove sys.getdxp() and analyze_dxp.py script ( #97671 )
...
Remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py
script. DXP stands for "dynamic execution pairs". They were related
to DYNAMIC_EXECUTION_PROFILE and DXPAIRS macros which have been
removed in Python 3.11. Python can now be built with "./configure
--enable-pystats" to gather statistics on Python opcodes.
2022-10-04 15:28:57 +02:00
Victor Stinner
6cbbc26a73
gh-97669: Remove outdated example scripts ( #97675 )
...
Remove outdated example scripts of the Tools/scripts/ directory. A
copy can be found in the old-demos project:
https://github.com/gvanrossum/old-demos
Removed scripts (39):
* byext.py
* byteyears.py
* cleanfuture.py
* copytime.py
* crlf.py
* db2pickle.py
* dutree.doc
* dutree.py
* find-uname.py
* find_recursionlimit.py
* finddiv.py
* findlinksto.py
* findnocoding.py
* fixcid.py
* fixdiv.py
* fixheader.py
* fixnotice.py
* fixps.py
* get-remote-certificate.py
* google.py
* highlight.py
* ifdef.py
* import_diagnostics.py
* lfcr.py
* linktree.py
* lll.py
* mailerdaemon.py
* make_ctype.py
* mkreal.py
* objgraph.py
* pdeps.py
* pickle2db.py
* pindent.py
* pysource.py
* reindent-rst.py
* rgrep.py
* suff.py
* texi2html.py
* which.py
Changes:
* Remove test_fixcid, test_lll, test_pdeps and test_pindent
of test.test_tools.
* Remove get-remote-certificate.py changelog entry, since the script
was removed.
Note: there is a copy of crlf.py in Lib/test/test_lib2to3/data/.
2022-10-04 10:49:00 +02:00
Koki Saito
27e59afa2a
gh-97816: Remove unused variables in mutliprocessing.managers.Server ( #97817 )
...
Remove unused local variables.
2022-10-03 22:29:17 -07:00
Nikita Sobolev
06016845dc
gh-97639: Remove tokenize.NL check from tabnanny ( #97640 )
...
* gh-97639: Remove `tokenize.NL` check from `tabnanny`
* 📜 🤖 Added by blurb_it.
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2022-10-03 17:41:29 -07:00
Shantanu
72b5a55bc8
Add comment to subtle dataclass code (gh-96133)
...
In the PR that made this change, 1st1 left a "note to self: add a
comment explaining this". This comment was never added.
https://github.com/python/cpython/pull/9518/files#r280608117
I was reading this code and it wasn't obvious to me why we weren't
exec-ing directly into locals. So I got to learn something new :-)
https://docs.python.org/3/reference/executionmodel.html#interaction-with-dynamic-features
2022-10-03 17:30:04 -07:00
Benjamin Peterson
9e8b86de4e
Remove space. (GH-97807)
...
Automerge-Triggered-By: GH:benjaminp
2022-10-03 17:12:36 -07:00
Brandt Bucher
93fcc1f413
GH-97752: Clear the previous member of newly-created generator/coroutine frames (GH-97795)
2022-10-04 00:36:52 +01:00
larryhastings
00b5a08c80
gh-97799: use inspect.get_annotations in dataclass ( #97800 )
...
dataclass used to get the annotations on a class object using
cls.__dict__.get('__annotations__'). Now that it always imports
inspect, it can use inspect.get_annotations, which is modern
best practice for coping with annotations.
2022-10-03 15:46:09 -07:00
Boris Verkhovskiy
0ea8b925d0
Document that MozillaCookieJar works for curl's cookie files ( #91852 )
...
MozillaCookieJar works for curl's cookies
2022-10-03 15:07:54 -07:00
Gregory P. Smith
b0f89cb431
gh-96512: Move int_max_str_digits setting to PyConfig ( #96944 )
...
It had to live as a global outside of PyConfig for stable ABI reasons in
the pre-3.12 backports.
This removes the `_Py_global_config_int_max_str_digits` and gets rid of
the equivalent field in the internal `struct _is PyInterpreterState` as
code can just use the existing nested config struct within that.
Adds tests to verify unique settings and configs in subinterpreters.
2022-10-03 13:55:45 -07:00
Michael Droettboom
cfbc7dd910
gh-94808: Coverage: Check picklablability of calliter ( #95923 )
2022-10-03 13:50:30 -07:00
MonadChains
9302e331c7
gh-94808: Add test coverage for PyObject_HasAttrString ( #96627 )
...
* gh-94808: Add test for HasAttrString
* Harmonize to Python C code style guidelines
* Add check to verify no exception thrown
2022-10-03 13:37:15 -07:00
hetmankp
3a49dbb98c
gh-94732: Fix KeyboardInterrupt race in asyncio run_forever() ( #97765 )
...
Ensure that the event loop's `_thread_id` attribute and the asyncgen hooks set by `sys.set_asyncgen_hooks()` are always restored no matter where a KeyboardInterrupt exception is raised.
2022-10-03 13:34:35 -07:00
Serhiy Storchaka
0ee9619a4c
gh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE converter (GH-97729)
...
It affects function os.system() on Windows and Windows-specific modules
winreg, _winapi, _overlapped, and _msi.
2022-10-03 10:42:54 +03:00
Koki Saito
19ca114645
gh-96819: multiprocessing.resource_tracker: check if length of pipe write <= 512 ( #96890 )
...
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-02 17:41:01 -07:00
Koki Saito
14d4f68ebb
gh-97706: multiprocessing tests: Delete unused variable rand ( #97707 )
2022-10-02 17:37:36 -07:00
Ofey Chan
d639438609
gh-97591: In Exception.__setstate__() acquire strong references before calling tp_hash slot ( #97700 )
2022-10-01 20:57:17 -07:00
Gregory P. Smith
8baef8ae36
gh-95588: Drop the safety claim from ast.literal_eval docs. ( #95919 )
...
It was never really safe and this claim conflicts directly with the big warning in the docs about it being able to crash the interpreter.
2022-10-01 17:55:40 -07:00
Łukasz Langa
f00645d5db
gh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() ( #95253 )
...
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-10-01 10:42:36 -07:00
Guido van Rossum
63780f4599
GH-97592: Fix crash in C remove_done_callback due to evil code ( #97660 )
...
Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called.
2022-09-30 12:57:09 -07:00
Guido van Rossum
e9d63760fe
GH-96827: Don't touch closed loops from executor threads ( #96837 )
...
* When chaining futures, skip callback if loop closed.
* When shutting down an executor, don't wake a closed loop.
2022-09-30 12:55:40 -07:00
Cheryl Sabella
1cc308d03c
bpo-35675: IDLE - separate config_key window and frame ( #11427 )
...
bpo-35598: IDLE: Refactor window and frame class
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-09-30 12:44:44 -04:00
Ofey Chan
83a3de4e06
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428)
2022-09-30 09:43:02 +01:00
Shin-myoung-serp
4652093e1b
gh-91212: Fixed flickering when the tracer is turned off ( #95129 )
...
Fixed flickering when the tracer is turned off.
2022-09-28 23:40:51 -07:00
Victor Stinner
a5f092f3c4
gh-97616: list_resize() checks for integer overflow ( #97617 )
...
Fix multiplying a list by an integer (list *= int): detect the
integer overflow when the new allocated length is close to the
maximum size. Issue reported by Jordan Limor.
list_resize() now checks for integer overflow before multiplying the
new allocated length by the list item size (sizeof(PyObject*)).
2022-09-29 00:07:07 +02:00
Jakob Weigert
81b9d9ddc2
Fix typo in error message in plistlib (GH-97540)
2022-09-28 20:46:09 +03:00