File tree 9 files changed +549
-41
lines changed
Filter options
9 files changed +549
-41
lines changed
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -150,3 +150,6 @@ Python/frozen_modules/MANIFEST
150
150
# Ignore ./python binary on Unix but still look into ./Python/ directory.
151
151
/python
152
152
! /Python /
153
+
154
+ # main branch only: ABI files are not checked/maintained
155
+ Doc /data /python * .abi
Original file line number Diff line number Diff line change @@ -216,6 +216,12 @@ Removed
216
216
217
217
.. _aiosmtpd : https://pypi.org/project/aiosmtpd/
218
218
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
+
219
225
220
226
Porting to Python 3.12
221
227
======================
Original file line number Diff line number Diff line change @@ -303,22 +303,6 @@ def _open_code_with_warning(path):
303
303
open_code = _open_code_with_warning
304
304
305
305
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
-
322
306
# In normal operation, both `UnsupportedOperation`s should be bound to the
323
307
# same object.
324
308
try :
Original file line number Diff line number Diff line change 57
57
IncrementalNewlineDecoder , text_encoding , TextIOWrapper )
58
58
59
59
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
-
76
60
# Pretend this exception was created here.
77
61
UnsupportedOperation .__module__ = "io"
78
62
Original file line number Diff line number Diff line change @@ -4301,14 +4301,6 @@ def test_text_encoding(self):
4301
4301
proc = assert_python_ok ('-X' , 'utf8=1' , '-c' , code )
4302
4302
self .assertEqual (b"utf-8" , proc .out .strip ())
4303
4303
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
-
4312
4304
4313
4305
class CMiscIOTest (MiscIOTest ):
4314
4306
io = io
You can’t perform that action at this time.
0 commit comments