pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/e745996b2d24b9234f896bdc2f3320e49287dcd0

55097560d244c08.css" /> gh-121609: Fix pasting of characters containing unicode character joi… · python/cpython@e745996 · GitHub
Skip to content

Commit e745996

Browse files
authored
gh-121609: Fix pasting of characters containing unicode character joiner (#121667)
1 parent 1801545 commit e745996

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

Lib/_pyrepl/reader.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def disp_str(buffer: str) -> tuple[str, list[int]]:
5858
elif unicodedata.category(c).startswith("C"):
5959
c = r"\u%04x" % ord(c)
6060
s.append(c)
61-
b.append(str_width(c))
6261
b.extend([0] * (len(c) - 1))
6362
else:
6463
s.append(c)

Lib/test/test_pyrepl/test_reader.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ def test_setpos_for_xy_simple(self):
8888
reader.setpos_from_xy(0, 0)
8989
self.assertEqual(reader.pos, 0)
9090

91+
def test_control_characters(self):
92+
code = 'flag = "🏳️‍🌈"'
93+
events = code_to_events(code)
94+
reader, _ = handle_all_events(events)
95+
self.assert_screen_equals(reader, 'flag = "🏳️\\u200d🌈"')
96+
9197
def test_setpos_from_xy_multiple_lines(self):
9298
# fmt: off
9399
code = (
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix pasting of characters containing unicode character joiners in the new REPL. Patch by Marta Gomez Macias

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy