Skip to content

Commit 10d0a6c

Browse files
Merge branch 'main' into jit-compiler-warning
2 parents 6fd59ce + 790cdae commit 10d0a6c

File tree

12 files changed

+59
-44
lines changed

12 files changed

+59
-44
lines changed

Doc/library/codecs.rst

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -989,17 +989,22 @@ defined in Unicode. A simple and straightforward way that can store each Unicode
989989
code point, is to store each code point as four consecutive bytes. There are two
990990
possibilities: store the bytes in big endian or in little endian order. These
991991
two encodings are called ``UTF-32-BE`` and ``UTF-32-LE`` respectively. Their
992-
disadvantage is that if e.g. you use ``UTF-32-BE`` on a little endian machine you
993-
will always have to swap bytes on encoding and decoding. ``UTF-32`` avoids this
994-
problem: bytes will always be in natural endianness. When these bytes are read
995-
by a CPU with a different endianness, then bytes have to be swapped though. To
996-
be able to detect the endianness of a ``UTF-16`` or ``UTF-32`` byte sequence,
997-
there's the so called BOM ("Byte Order Mark"). This is the Unicode character
998-
``U+FEFF``. This character can be prepended to every ``UTF-16`` or ``UTF-32``
999-
byte sequence. The byte swapped version of this character (``0xFFFE``) is an
1000-
illegal character that may not appear in a Unicode text. So when the
1001-
first character in a ``UTF-16`` or ``UTF-32`` byte sequence
1002-
appears to be a ``U+FFFE`` the bytes have to be swapped on decoding.
992+
disadvantage is that if, for example, you use ``UTF-32-BE`` on a little endian
993+
machine you will always have to swap bytes on encoding and decoding.
994+
Python's ``UTF-16`` and ``UTF-32`` codecs avoid this problem by using the
995+
platform's native byte order when no BOM is present.
996+
Python follows prevailing platform
997+
practice, so native-endian data round-trips without redundant byte swapping,
998+
even though the Unicode Standard defaults to big-endian when the byte order is
999+
unspecified. When these bytes are read by a CPU with a different endianness,
1000+
the bytes have to be swapped. To be able to detect the endianness of a
1001+
``UTF-16`` or ``UTF-32`` byte sequence, a BOM ("Byte Order Mark") is used.
1002+
This is the Unicode character ``U+FEFF``. This character can be prepended to every
1003+
``UTF-16`` or ``UTF-32`` byte sequence. The byte swapped version of this character
1004+
(``0xFFFE``) is an illegal character that may not appear in a Unicode text.
1005+
When the first character of a ``UTF-16`` or ``UTF-32`` byte sequence is
1006+
``U+FFFE``, the bytes have to be swapped on decoding.
1007+
10031008
Unfortunately the character ``U+FEFF`` had a second purpose as
10041009
a ``ZERO WIDTH NO-BREAK SPACE``: a character that has no width and doesn't allow
10051010
a word to be split. It can e.g. be used to give hints to a ligature algorithm.

Doc/library/tkinter.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,8 +839,7 @@ geometry
839839
For example: ``fred["geometry"] = "200x100"``.
840840

841841
justify
842-
Legal values are the strings: ``"left"``, ``"center"``, ``"right"``, and
843-
``"fill"``.
842+
Legal values are the strings: ``"left"``, ``"center"``, and ``"right"``.
844843

845844
region
846845
This is a string with four space-delimited elements, each of which is a legal

Include/internal/pycore_interp_structs.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -769,12 +769,6 @@ struct _is {
769769
* and should be placed at the beginning. */
770770
struct _ceval_state ceval;
771771

772-
/* This structure is carefully allocated so that it's correctly aligned
773-
* to avoid undefined behaviors during LOAD and STORE. The '_malloced'
774-
* field stores the allocated pointer address that will later be freed.
775-
*/
776-
void *_malloced;
777-
778772
PyInterpreterState *next;
779773

780774
int64_t id;

Lib/asyncio/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ def run(self):
107107
if CAN_USE_PYREPL:
108108
theme = get_theme().syntax
109109
ps1 = f"{theme.prompt}{ps1}{theme.reset}"
110-
console.write(f"{ps1}import asyncio\n")
110+
import_line = f'{theme.keyword}import{theme.reset} asyncio'
111+
else:
112+
import_line = "import asyncio"
113+
console.write(f"{ps1}{import_line}\n")
111114

112115
if CAN_USE_PYREPL:
113116
from _pyrepl.simple_interact import (

Lib/idlelib/idle_test/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,4 @@ def load_tests(loader, standard_tests, pattern):
2020
pattern='test_*.py', # Insert here.
2121
top_level_dir=top_dir)
2222
standard_tests.addTests(module_tests)
23-
## module_tests = loader.discover(start_dir=this_dir,
24-
## pattern='test_*.py', # Insert here.
25-
## top_level_dir=top_dir)
26-
## standard_tests.addTests(module_tests)
2723
return standard_tests

Lib/test/test_threading.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,6 +1776,7 @@ def task():
17761776
self.assertEqual(os.read(r_interp, 1), DONE)
17771777

17781778
@cpython_only
1779+
@support.skip_if_sanitizer(thread=True, memory=True)
17791780
def test_daemon_threads_fatal_error(self):
17801781
import_module("_testcapi")
17811782
subinterp_code = f"""if 1:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix undefined behavior when using unaligned store in JIT's ``patch_*`` functions.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix memory leak in sub-interpreter creation.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix data race between interpreter_clear() and take_gil() on eval_breaker
2+
during finalization with daemon threads.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Colorize the default import statement ``import asyncio`` in asyncio REPL.

0 commit comments

Comments
 (0)