Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1f839b9

Browse filesBrowse files
authored
Merge branch 'main' into privatize-smtpd
2 parents 38fd57b + 6e33ba1 commit 1f839b9
Copy full SHA for 1f839b9

File tree

9 files changed

+549
-41
lines changed
Filter options

9 files changed

+549
-41
lines changed

‎.github/workflows/regen-abidump.sh

Copy file name to clipboard
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
set -ex
2+
3+
export DEBIAN_FRONTEND=noninteractive
4+
./.github/workflows/posix-deps-apt.sh
5+
apt-get install -yq abigail-tools python3
6+
export CFLAGS="-g3 -O0"
7+
./configure --enable-shared && make
8+
make regen-abidump

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,6 @@ Python/frozen_modules/MANIFEST
150150
# Ignore ./python binary on Unix but still look into ./Python/ directory.
151151
/python
152152
!/Python/
153+
154+
# main branch only: ABI files are not checked/maintained
155+
Doc/data/python*.abi

‎Doc/whatsnew/3.12.rst

Copy file name to clipboardExpand all lines: Doc/whatsnew/3.12.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ Removed
216216

217217
.. _aiosmtpd: https://pypi.org/project/aiosmtpd/
218218

219+
* Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated in Python
220+
3.10: just use :func:`open` instead. The :func:`open` (:func:`io.open`)
221+
function is a built-in function. Since Python 3.10, :func:`_pyio.open` is
222+
also a static method.
223+
(Contributed by Victor Stinner in :gh:`94169`.)
224+
219225

220226
Porting to Python 3.12
221227
======================

‎Lib/_pyio.py

Copy file name to clipboardExpand all lines: Lib/_pyio.py
-16Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -303,22 +303,6 @@ def _open_code_with_warning(path):
303303
open_code = _open_code_with_warning
304304

305305

306-
def __getattr__(name):
307-
if name == "OpenWrapper":
308-
# bpo-43680: Until Python 3.9, _pyio.open was not a static method and
309-
# builtins.open was set to OpenWrapper to not become a bound method
310-
# when set to a class variable. _io.open is a built-in function whereas
311-
# _pyio.open is a Python function. In Python 3.10, _pyio.open() is now
312-
# a static method, and builtins.open() is now io.open().
313-
import warnings
314-
warnings.warn('OpenWrapper is deprecated, use open instead',
315-
DeprecationWarning, stacklevel=2)
316-
global OpenWrapper
317-
OpenWrapper = open
318-
return OpenWrapper
319-
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
320-
321-
322306
# In normal operation, both `UnsupportedOperation`s should be bound to the
323307
# same object.
324308
try:

‎Lib/io.py

Copy file name to clipboardExpand all lines: Lib/io.py
-16Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,6 @@
5757
IncrementalNewlineDecoder, text_encoding, TextIOWrapper)
5858

5959

60-
def __getattr__(name):
61-
if name == "OpenWrapper":
62-
# bpo-43680: Until Python 3.9, _pyio.open was not a static method and
63-
# builtins.open was set to OpenWrapper to not become a bound method
64-
# when set to a class variable. _io.open is a built-in function whereas
65-
# _pyio.open is a Python function. In Python 3.10, _pyio.open() is now
66-
# a static method, and builtins.open() is now io.open().
67-
import warnings
68-
warnings.warn('OpenWrapper is deprecated, use open instead',
69-
DeprecationWarning, stacklevel=2)
70-
global OpenWrapper
71-
OpenWrapper = open
72-
return OpenWrapper
73-
raise AttributeError("module {__name__!r} has no attribute {name!r}")
74-
75-
7660
# Pretend this exception was created here.
7761
UnsupportedOperation.__module__ = "io"
7862

‎Lib/test/test_io.py

Copy file name to clipboardExpand all lines: Lib/test/test_io.py
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4301,14 +4301,6 @@ def test_text_encoding(self):
43014301
proc = assert_python_ok('-X', 'utf8=1', '-c', code)
43024302
self.assertEqual(b"utf-8", proc.out.strip())
43034303

4304-
@support.cpython_only
4305-
# Depending if OpenWrapper was already created or not, the warning is
4306-
# emitted or not. For example, the attribute is already created when this
4307-
# test is run multiple times.
4308-
@warnings_helper.ignore_warnings(category=DeprecationWarning)
4309-
def test_openwrapper(self):
4310-
self.assertIs(self.io.OpenWrapper, self.io.open)
4311-
43124304

43134305
class CMiscIOTest(MiscIOTest):
43144306
io = io

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.