summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2023-01-20 07:04:30 (GMT)
committerGitHub <noreply@github.com>2023-01-20 07:04:30 (GMT)
commit5927013e47a8c63b70e104152351f3447baa819c (patch)
tree277eabd54cc4d1755178ff3ba3a8ea779d25528a /Misc
parent9e025d305f159aebf01775ad1dc2817679f01aa9 (diff)
downloadcpython-5927013e47a8c63b70e104152351f3447baa819c.zip
cpython-5927013e47a8c63b70e104152351f3447baa819c.tar.gz
cpython-5927013e47a8c63b70e104152351f3447baa819c.tar.bz2
gh-101144: Allow open and read_text encoding to be positional. (#101145)
The zipfile.Path open() and read_text() encoding parameter can be supplied as a positional argument without causing a TypeError again. 3.10.0b1 included a regression that made it keyword only. Documentation update included as users writing code to be compatible with a wide range of versions will need to consider this for some time.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2023-01-18-17-58-50.gh-issue-101144.FHd8Un.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2023-01-18-17-58-50.gh-issue-101144.FHd8Un.rst b/Misc/NEWS.d/next/Library/2023-01-18-17-58-50.gh-issue-101144.FHd8Un.rst
new file mode 100644
index 0000000..2976522
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-01-18-17-58-50.gh-issue-101144.FHd8Un.rst
@@ -0,0 +1,4 @@
+Make :func:`zipfile.Path.open` and :func:`zipfile.Path.read_text` also accept
+``encoding`` as a positional argument. This was the behavior in Python 3.9 and
+earlier. 3.10 introduced a regression where supplying it as a positional
+argument would lead to a :exc:`TypeError`.