Skip to content

Commit 54bdd7e

Browse files
authored
Merge branch '3.13' into backport-7dae107-3.13
2 parents 0dd1bd1 + 4d8abae commit 54bdd7e

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

Doc/deprecations/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Deprecations
99

1010
.. include:: pending-removal-in-3.17.rst
1111

12+
.. include:: pending-removal-in-3.18.rst
13+
1214
.. include:: pending-removal-in-future.rst
1315

1416
C API Deprecations
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Pending removal in Python 3.18
2+
------------------------------
3+
4+
* :mod:`decimal`:
5+
6+
* The non-standard and undocumented :class:`~decimal.Decimal` format
7+
specifier ``'N'``, which is only supported in the :mod:`!decimal` module's
8+
C implementation, has been deprecated since Python 3.13.
9+
(Contributed by Serhiy Storchaka in :gh:`89902`.)

Doc/whatsnew/3.13.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,7 @@ New Deprecations
18701870
* Deprecate the non-standard and undocumented :class:`~decimal.Decimal`
18711871
format specifier ``'N'``,
18721872
which is only supported in the :mod:`!decimal` module's C implementation.
1873+
Scheduled to be removed in Python 3.18.
18731874
(Contributed by Serhiy Storchaka in :gh:`89902`.)
18741875

18751876
* :mod:`dis`:
@@ -2034,6 +2035,8 @@ New Deprecations
20342035

20352036
.. include:: ../deprecations/pending-removal-in-3.17.rst
20362037

2038+
.. include:: ../deprecations/pending-removal-in-3.18.rst
2039+
20372040
.. include:: ../deprecations/pending-removal-in-future.rst
20382041

20392042
CPython Bytecode Changes

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,17 @@ def test_no_newline(self):
14651465
safe_patterns.append(r'\x1b\[\?25[hl]') # cursor visibility
14661466
safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking
14671467

1468+
# rmam / smam - automatic margins
1469+
rmam = curses.tigetstr("rmam")
1470+
smam = curses.tigetstr("smam")
1471+
if rmam:
1472+
safe_patterns.append(re.escape(rmam.decode("ascii")))
1473+
if smam:
1474+
safe_patterns.append(re.escape(smam.decode("ascii")))
1475+
if not rmam and not smam:
1476+
safe_patterns.append(r'\x1b\[\?7l') # turn off automatic margins
1477+
safe_patterns.append(r'\x1b\[\?7h') # turn on automatic margins
1478+
14681479
# Modern extensions not in standard terminfo - always use patterns
14691480
safe_patterns.append(r'\x1b\[\?2004[hl]') # bracketed paste mode
14701481
safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking (may be separate)

Modules/_decimal/_decimal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3462,7 +3462,8 @@ dec_format(PyObject *dec, PyObject *args)
34623462

34633463
if (size > 0 && fmt[size-1] == 'N') {
34643464
if (PyErr_WarnEx(PyExc_DeprecationWarning,
3465-
"Format specifier 'N' is deprecated", 1) < 0) {
3465+
"Format specifier 'N' is deprecated and "
3466+
"slated for removal in Python 3.18", 1) < 0) {
34663467
return NULL;
34673468
}
34683469
}

0 commit comments

Comments
 (0)