Commit Graph

27343 Commits

Author SHA1 Message Date
Irit Katriel d1e4917e06
gh-102778: IDLE - make sys.last_exc available in Shell after traceback (#103314)
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-04-19 01:05:52 -04:00
Ethan Furman 700ec657c8
gh-103596: [Enum] do not shadow mixed-in methods/attributes (GH-103600)
For example:

    class Book(StrEnum):
        title = auto()
        author = auto()
        desc = auto()

    Book.author.desc is Book.desc

but

    Book.author.title() == 'Author'

is commonly expected.  Using upper-case member names avoids this confusion and possible performance impacts.

Co-authored-by: samypr100 <3933065+samypr100@users.noreply.github.com>
2023-04-18 16:19:23 -07:00
Nikita Sobolev 07804ce24c
GH-100530: Change the error message for non-class class patterns (GH-103576) 2023-04-18 10:41:14 -07:00
Pradyun Gedam ece20dba12
gh-95299: Stop installing setuptools as a part of ensurepip and venv (#101039)
Remove the bundled setuptools wheel from ensurepip, and stop installing setuptools in environments created by venv.

Co-Authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-04-17 23:43:34 -05:00
Nikita Sobolev b57f55c23e
gh-103449: Fix a bug in dataclass docstring generation (#103454) 2023-04-17 17:33:22 -06:00
AN Long d83faf7f1b
gh-103092: Isolate winreg (#103250) 2023-04-17 12:30:48 -06:00
chgnrdv 2b6f5c3483
gh-102114: Make dis print more concise tracebacks for syntax errors in str inputs (#102115) 2023-04-15 06:53:31 +01:00
Barney Gale 8af8f52d17
GH-78079: Fix UNC device path root normalization in pathlib (GH-102003)
We no longer add a root to device paths such as `//./PhysicalDrive0`,
`//?/BootPartition` and `//./c:` while normalizing. We also avoid adding a
root to incomplete UNC share paths, like `//`, `//a` and `//a/`.

Co-authored-by: Eryk Sun <eryksun@gmail.com>
2023-04-14 21:55:41 +01:00
Zachary Ware 95ee7c47ab
gh-103532: Fix reST syntax in NEWS entry (GH-103544) 2023-04-14 11:03:28 -05:00
Zachary Ware e32c197ad3
gh-103532: Add NEWS entry (#103542) 2023-04-14 10:28:53 -05:00
Ethan Furman 2194071540
gh-103365: [Enum] STRICT boundary corrections (GH-103494)
STRICT boundary:

- fix bitwise operations
- make default for Flag
2023-04-13 08:24:33 -07:00
Mark Shannon efb8a2553c
GH-103488: Use return-offset, not yield-offset. (GH-103502)
* Use return-offset, not yield-offset, so that instruction pointer is correct when sending to a generator or coroutine.
2023-04-13 16:19:07 +01:00
Tomas R 59e0de4903
gh-102978: Fix mock.patch function signatures for class and staticmethod decorators (#103228)
Fixes unittest.mock.patch not enforcing function signatures for methods
decorated with @classmethod or @staticmethod when patch is called with
autospec=True.
2023-04-13 08:37:57 +01:00
Ali-Akber Saifee 19d2639d1e
gh-103462: Ensure SelectorSocketTransport.writelines registers a writer when data is still pending (#103463) 2023-04-13 10:16:52 +05:30
Skip Montanaro 330a942b63
gh-67230: add quoting rules to csv module (GH-29469)
Add two quoting styles for csv dialects.
They will help to work with certain databases in particular.

Automerge-Triggered-By: GH:merwok
2023-04-12 15:32:30 -07:00
Stanislav Syekirin 2b6e877767
gh-103088: Fix virtual environment activate script not working in Cygwin (GH-103470) 2023-04-12 21:11:50 +01:00
Erlend E. Aasland 52f96d3ea3
gh-103092: Isolate `_collections` (#103093)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-04-12 18:21:28 +05:30
Mark Shannon 411b169281
GH-103082: Implementation of PEP 669: Low Impact Monitoring for CPython (GH-103083)
* The majority of the monitoring code is in instrumentation.c

* The new instrumentation bytecodes are in bytecodes.c

* legacy_tracing.c adapts the new API to the old sys.setrace and sys.setprofile APIs
2023-04-12 12:04:55 +01:00
AN Long dce2d38cb0
gh-103092: Isolate msvcrt (#103248) 2023-04-12 12:41:21 +02:00
Bar Harel 8f54302ab4
gh-103357: Add logging.Formatter defaults support to logging.config fileConfig and dictConfig (GH-103359) 2023-04-12 08:35:56 +01:00
Tian Gao 2f41a009b7
gh-103143: Polish pdb help messages and doc strings (GH-103144)
* Made all the command part of the docstring match the official documentation
* Always have a space between the command and the description in docstring
* Added a helper function to format the help message

Before:

```
(Pdb) h a
a(rgs)
        Print the argument list of the current function.
(Pdb) h commands
commands [bpnumber]
        (com) ...
        (com) end
        (Pdb)
        ...
(Pdb) h interact
interact

        Start an interactive interpreter whose global namespace
        contains all the (global and local) names found in the current scope.
```

After
```
(Pdb) h a
      Usage: a(rgs)
      
      Print the argument list of the current function.
(Pdb) h commands
      Usage: (Pdb) commands [bpnumber]
             (com) ...
             (com) end
             (Pdb)
             ...
(Pdb) h interact
      Usage: interact
      
      Start an interactive interpreter whose global namespace
      contains all the (global and local) names found in the current scope.
```

Automerge-Triggered-By: GH:brandtbucher
2023-04-11 15:40:30 -07:00
Stanislav Syekirin ebc8103427
gh-103088: Sanitize venv paths when using MSYS or Cygwin Bash (GH-103325) 2023-04-11 20:20:46 +01:00
Barney Gale b57105ae33
GH-103220: Fix `ntpath.join()` of partial UNC drive with trailing slash (GH-103221) 2023-04-11 17:26:45 +01:00
Irit Katriel 55c99d97e1
gh-77757: replace exception wrapping by PEP-678 notes in typeobject's __set_name__ (#103402) 2023-04-11 11:53:06 +01:00
Irit Katriel 78b763f630
gh-103176: sys._current_exceptions() returns mapping to exception instances instead of exc_info tuples (#103177) 2023-04-11 09:38:37 +01:00
David Ellis d034590294
gh-103000: Optimise dataclasses asdict/astuple for common types (#103005)
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-04-10 22:50:58 +01:00
AN Long f80014a9b0
gh-103092: Isolate winsound (#103249) 2023-04-10 23:01:05 +02:00
raylu 8b1b17134e
gh-103059: Clarify gc.freeze documentation (#103058) 2023-04-10 10:30:32 -06:00
Barney Gale 2c673d5e93
GH-101362: Omit path anchor from `pathlib.PurePath()._parts` (GH-102476)
Improve performance of path construction by skipping the addition of the path anchor (`drive + root`) to the internal `_parts` list. Rename this attribute to `_tail` for clarity.
2023-04-09 18:40:03 +01:00
Erlend E. Aasland f329a8bc1e
gh-103092: Isolate `socket` module (#103094) 2023-04-09 06:33:52 +05:30
Dong-hee Na 35167043e3
gh-103242: Migrate SSLContext.set_ecdh_curve not to use deprecated APIs (#103378)
Migrate `SSLContext.set_ecdh_curve()` not to use deprecated OpenSSL APIs.
2023-04-08 10:56:42 -07:00
C.A.M. Gerlach a34c796238
gh-75729: Fix os.spawn tests not handling spaces on Windows (#99150)
* Quote paths in os.spawn tests on Windows so they work with spaces

* Add NEWS entry for os spawn test fix

* Fix code style to avoid double negative in os.spawn tests

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-04-08 10:37:23 +03:00
Tomáš Hrnčiar 13774969f7
gh-102809: Remove gdbinit mention in Misc/README (#103269) 2023-04-08 00:04:23 -07:00
Russell Keith-Magee 26c65980dc
gh-103329: Add regression test for PropertyMock with side effect (#103358) 2023-04-07 20:09:00 -06:00
Alex Waygood 644136563d
gh-74690: Document changes made to runtime-checkable protocols in 3.12 (#103348)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-04-07 22:06:37 +01:00
Michał Górny a90863c993
gh-100220: Fix error handling in make rules (GH-100328)
Set `SHELL = /bin/sh -e` to ensure that complex recipes fail on the first error rather than incorrectly reporting success.

Co-authored-by: Zachary Ware <zach@python.org>
2023-04-07 13:23:59 -05:00
Tian Gao 2667452945
gh-103225: Fixed zero lineno issue for pdb (#103265)
Co-authored-by: Artem Mukhin <ortem00@gmail.com>
2023-04-07 18:57:46 +01:00
AN Long 4dc339b4d6
GH-88013: Fix TypeError raised by ntpath.realpath in some cases (GH-102813) 2023-04-07 12:56:00 +01:00
Dong-hee Na efb0a2cf3a
gh-103256: Fix hmac algorithm to support fallback implementation (gh-103286)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-04-07 10:51:29 +09:00
Brett Cannon 5d08c3ff7d
GH-102700: allow built-in modules to be submodules (GH-103162) 2023-04-06 14:19:54 -07:00
Jeffrey Newman 23cf1e20a6
gh-99202: Fix extension type from documentation for compiling in C++20 mode (#102518) 2023-04-06 17:59:36 +02:00
Ethan Furman 4ec8dd10bd
gh-93910: [Enum] remove member.member deprecation (GH-103236)
i.e. Color.RED.BLUE is now officially supported.
2023-04-05 17:33:52 -07:00
Brandt Bucher b4978ff872
GH-88691: Shrink the CALL caches (GH-103230) 2023-04-05 14:15:49 -07:00
Joshua Root 96e1901a59
gh-99069: Consolidate checks for static_assert (#94766)
Several platforms don't define the static_assert macro despite having
compiler support for the _Static_assert keyword. The macro needs to be
defined since it is used unconditionally in the Python code. So it
should always be safe to define it if undefined and not in C++11 (or
later) mode.

Hence, remove the checks for particular platforms or libc versions,
and just define static_assert anytime it needs to be defined but isn't.
That way, all platforms that need the fix will get it, regardless of
whether someone specifically thought of them.

Also document that certain macOS versions are among the platforms that
need this.

The C2x draft (currently expected to become C23) makes static_assert
a keyword to match C++. So only define the macro for up to C17.

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-04-05 17:09:19 +02:00
Yeojin Kim 8f70b16e33
gh-86094: Add support for Unicode Path Extra Field in ZipFile (gh-102566) 2023-04-05 20:54:48 +09:00
Alex Waygood 264c00a1c5
gh-103193: Micro-optimise helper functions for `inspect.getattr_static` (#103195) 2023-04-05 08:27:01 +01:00
Michael Handler 1a8f862e32
gh-66897: Upgrade HTTP CONNECT to protocol HTTP/1.1 (#8305)
* bpo-22708: Upgrade HTTP CONNECT to protocol HTTP/1.1 (GH-NNNN)

Use protocol HTTP/1.1 when sending HTTP CONNECT tunnelling requests;
generate Host: headers if one is not already provided (required by
HTTP/1.1), convert IDN domains to punycode in HTTP CONNECT requests.

* Refactor tests to pass under -bb (fix ByteWarnings); missed some lines >80.

* Use consistent 'tunnelling' spelling in Lib/http/client.py

* Lib/test/test_httplib: Remove remnant of obsoleted test.

* Use dict.copy() not copy.copy()

* fix version changed

* Update Lib/http/client.py

Co-authored-by: bgehman <bgehman@users.noreply.github.com>

* Switch to for/else: syntax, as suggested

* Don't use for: else:

* Sure, fine, w/e

* Oops

* 1nm to the left

---------

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: bgehman <bgehman@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-04-04 21:55:24 -07:00
Charles Machalow 935aa45235
GH-75586: Make shutil.which() on Windows more consistent with the OS (GH-103179) 2023-04-04 23:24:13 +01:00
Ned Deily f184abbdc9
gh-103207: Add instructions to the macOS installer welcome display on how to workaround the macOS 13 Ventura “The installer encountered an error” failure. (GH-103251) 2023-04-04 17:06:00 -04:00
Thomas Wouters 30f82cf6c9 Merge branch 'main' of https://github.com/python/cpython into main 2023-04-04 22:01:07 +02:00