Skip to content

Commit 3fffad2

Browse files
generatedunixname1734921407115435facebook-github-bot
authored andcommitted
Import upstream CPython branch '3.14'
Summary: Python `3.14.0rc1+` (`3.14`) was **published** on 2025-08-04 10:34:16+00:00. # Commit Info Base: (`3.14.0rc1+`) - `42b58cfa4216e4d53737a9d61a93b3be4f9beb91` (commit date: 2025-07-31 04:07:44+00:00) Imported: (`3.14.0rc1+`) - `3.14` (commit date: 2025-08-04 10:34:16+00:00) # Files added ```javascript Lib/ensurepip/_bundled/pip-25.2-py3-none-any.whl Misc/NEWS.d/next/Core_and_Builtins/2025-08-02-23-04-57.gh-issue-137314.wjEdzD.rst Misc/NEWS.d/next/Library/2025-07-30-18-07-33.gh-issue-137257.XBtzf2.rst ``` # Files removed ```javascript Lib/ensurepip/_bundled/pip-25.1.1-py3-none-any.whl ``` Reviewed By: itamaro, zsol Differential Revision: D79552892 fbshipit-source-id: 8b0b5a934f9ecb1fbcd242f911b92ac029617a9e
1 parent 999d84d commit 3fffad2

14 files changed

Lines changed: 58 additions & 16 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
.github/** @ezio-melotti @hugovk @AA-Turner
99

1010
# pre-commit
11-
.pre-commit-config.yaml @hugovk @AlexWaygood
11+
.pre-commit-config.yaml @hugovk
1212
.ruff.toml @hugovk @AlexWaygood @AA-Turner
1313

1414
# Build system

Doc/library/urllib.request.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ The following attribute and methods should only be used by classes derived from
837837
1. a :class:`Request` object,
838838
#. a file-like object with the HTTP error body,
839839
#. the three-digit code of the error, as a string,
840-
#. the user-visible explanation of the code, as as string, and
840+
#. the user-visible explanation of the code, as a string, and
841841
#. the headers of the error, as a mapping object.
842842

843843
Return values and exceptions raised should be the same as those of

Doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sphinx~=8.2.0
1111

1212
blurb
1313

14-
sphinxext-opengraph~=0.10.0
14+
sphinxext-opengraph~=0.11.0
1515
sphinx-notfound-page~=1.0.0
1616

1717
# The theme used by the documentation is stored separately, so we need

Lib/asyncio/base_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ def _check_running(self):
636636
def _run_forever_setup(self):
637637
"""Prepare the run loop to process events.
638638
639-
This method exists so that custom custom event loop subclasses (e.g., event loops
639+
This method exists so that custom event loop subclasses (e.g., event loops
640640
that integrate a GUI event loop with Python's event loop) have access to all the
641641
loop setup logic.
642642
"""
@@ -656,7 +656,7 @@ def _run_forever_setup(self):
656656
def _run_forever_cleanup(self):
657657
"""Clean up after an event loop finishes the looping over events.
658658
659-
This method exists so that custom custom event loop subclasses (e.g., event loops
659+
This method exists so that custom event loop subclasses (e.g., event loops
660660
that integrate a GUI event loop with Python's event loop) have access to all the
661661
loop cleanup logic.
662662
"""

Lib/ensurepip/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
__all__ = ["version", "bootstrap"]
13-
_PIP_VERSION = "25.1.1"
13+
_PIP_VERSION = "25.2"
1414

1515
# Directory of system wheel packages. Some Linux distribution packaging
1616
# policies recommend against bundling dependencies. For example, Fedora
1.74 MB
Binary file not shown.

Lib/test/libregrtest/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def normalize_test_name(test_full_name: str, *,
536536
if is_error and short_name in _TEST_LIFECYCLE_HOOKS:
537537
if test_full_name.startswith(('setUpModule (', 'tearDownModule (')):
538538
# if setUpModule() or tearDownModule() failed, don't filter
539-
# tests with the test file name, don't use use filters.
539+
# tests with the test file name, don't use filters.
540540
return None
541541

542542
# This means that we have a failure in a life-cycle hook,

Lib/test/support/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ def check__all__(test_case, module, name_of_module=None, extra=(),
16791679
'module'.
16801680
16811681
The 'name_of_module' argument can specify (as a string or tuple thereof)
1682-
what module(s) an API could be defined in in order to be detected as a
1682+
what module(s) an API could be defined in order to be detected as a
16831683
public API. One case for this is when 'module' imports part of its public
16841684
API from other modules, possibly a C backend (like 'csv' and its '_csv').
16851685

Lib/test/test_fstring.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,6 +1831,34 @@ def test_newlines_in_format_specifiers(self):
18311831
for case in valid_cases:
18321832
compile(case, "<string>", "exec")
18331833

1834+
def test_raw_fstring_format_spec(self):
1835+
# Test raw f-string format spec behavior (Issue #137314).
1836+
#
1837+
# Raw f-strings should preserve literal backslashes in format specifications,
1838+
# not interpret them as escape sequences.
1839+
class UnchangedFormat:
1840+
"""Test helper that returns the format spec unchanged."""
1841+
def __format__(self, format):
1842+
return format
1843+
1844+
# Test basic escape sequences
1845+
self.assertEqual(f"{UnchangedFormat():\xFF}", 'ÿ')
1846+
self.assertEqual(rf"{UnchangedFormat():\xFF}", '\\xFF')
1847+
1848+
# Test nested expressions with raw/non-raw combinations
1849+
self.assertEqual(rf"{UnchangedFormat():{'\xFF'}}", 'ÿ')
1850+
self.assertEqual(f"{UnchangedFormat():{r'\xFF'}}", '\\xFF')
1851+
self.assertEqual(rf"{UnchangedFormat():{r'\xFF'}}", '\\xFF')
1852+
1853+
# Test continuation character in format specs
1854+
self.assertEqual(f"""{UnchangedFormat():{'a'\
1855+
'b'}}""", 'ab')
1856+
self.assertEqual(rf"""{UnchangedFormat():{'a'\
1857+
'b'}}""", 'ab')
1858+
1859+
# Test multiple format specs in same raw f-string
1860+
self.assertEqual(rf"{UnchangedFormat():\xFF} {UnchangedFormat():\n}", '\\xFF \\n')
1861+
18341862

18351863
if __name__ == '__main__':
18361864
unittest.main()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Fixed a regression where raw f-strings incorrectly interpreted
2+
escape sequences in format specifications. Raw f-strings now properly preserve
3+
literal backslashes in format specs, matching the behavior from Python 3.11.
4+
For example, ``rf"{obj:\xFF}"`` now correctly produces ``'\\xFF'`` instead of
5+
``'ÿ'``. Patch by Pablo Galindo.

0 commit comments

Comments
 (0)