Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-130328: Speedup pasting in legacy console on Windows#133728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ambv merged 4 commits intopython:mainfromchris-eibl:speedup_paste_legacy
May 25, 2025

Conversation

chris-eibl
Copy link
Member

@chris-eiblchris-eibl commentedMay 9, 2025
edited by bedevere-appbot
Loading

for i in range(rec_count):
rec = recs[i]
# In case of a legacy console, we do not only receive a keydown
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Actually, there is a lot of duplicated logic fromget_event now. Maybe refactor that, so the logic can be reused here?

@@ -449,8 +442,11 @@ def get_event(self, block: bool = True) -> Event | None:
and there is no event pending, otherwise waits for the
completion of an event."""

if not block and not self.wait(timeout=0):
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I have moved blocking and waiting logic intoget_event like inunix_console.py. IMHO that shouldn't be part of reading and we're in perfect sync with Unix now.

ambv reacted with thumbs up emoji
@@ -484,7 +491,6 @@ def do(self) -> None:
data = ""
start = time.time()
while done not in data:
self.reader.console.wait(100)
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think this is needed. Works for me without it. For both, Linux and Windows, this will immediately return in case of pending data, and just needlessly waits 100 ms if there is no more data.

Copy link
Contributor

@ambvambv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is perfect. You utilized mygetpending() implementation without adding any double-buffering. It is indeed speeding things up dramatically while not breaking the existing bracketed paste behavior.

chris-eibl reacted with heart emoji
@ambvambv added the needs backport to 3.14bugs and security fixes labelMay 25, 2025
@ambvambv merged commit91b4886 intopython:mainMay 25, 2025
53 checks passed
@miss-islington-app
Copy link

Thanks@chris-eibl for the PR, and@ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 25, 2025
…gh-133728)(cherry picked from commit91b4886)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
@bedevere-app
Copy link

GH-134653 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelMay 25, 2025
ambv pushed a commit that referenced this pull requestMay 25, 2025
…3728) (#134653)(cherry picked from commit91b4886)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 Windows10 3.x (tier-1) has failed when building commit91b4886.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/146/builds/11526) and take a look at the build logs.
  4. Check if the failure is related to this commit (91b4886) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/146/builds/11526

Failed tests:

  • test_pyrepl

Failed subtests:

  • test_up_vt - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_up_vt
  • test_left - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left
  • test_KEY_EVENT_up_ignored - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_KEY_EVENT_up_ignored
  • test_enter_vt - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_enter_vt
  • test_m_LEFT_ALT_PRESSED_and_LEFT_CTRL_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_m_LEFT_ALT_PRESSED_and_LEFT_CTRL_PRESSED
  • test_WINDOW_BUFFER_SIZE_EVENT - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_WINDOW_BUFFER_SIZE_EVENT
  • test_backspace_vt - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_backspace_vt
  • test_left_RIGHT_CTRL_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left_RIGHT_CTRL_PRESSED
  • test_AltGr_m - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_AltGr_m
  • test_EmptyBuffer - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_EmptyBuffer
  • test_unhandled_events - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_unhandled_events
  • test_left_RIGHT_ALT_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left_RIGHT_ALT_PRESSED
  • test_AltGr_7 - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_AltGr_7
  • test_m_LEFT_ALT_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_m_LEFT_ALT_PRESSED
  • test_backspace - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_backspace
  • test_enter - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_enter
  • test_M - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_M
  • test_m - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_m
  • test_umlaut_a_german - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_umlaut_a_german
  • test_left_LEFT_ALT_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left_LEFT_ALT_PRESSED
  • test_left_LEFT_CTRL_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left_LEFT_CTRL_PRESSED
  • test_m_RIGHT_ALT_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_m_RIGHT_ALT_PRESSED

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line415, intest_WINDOW_BUFFER_SIZE_EVENTself.assertEqual(self.get_event([ir]), Event("resize",""))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='resize', data='', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line466, intest_left_RIGHT_CTRL_PRESSEDself.assertEqual(~~~~~~~~~~~~~~~~^self.get_event([ir]), Event("key","ctrl left"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='ctrl left', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line534, intest_AltGr_7self.assertEqual(self.get_event([ir]), Event("key","{"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='{', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line454, intest_Mself.assertEqual(self.get_event([ir]), Event("key","M"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='M', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line562, intest_enter_vtself.assertEqual(self.get_event([ir],vt_support=True),~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                     Event("key","\n"))^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\n', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line449, intest_mself.assertEqual(self.get_event([ir]), Event("key","m"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='m', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line510, intest_m_LEFT_ALT_PRESSEDself.assertEqual(self.get_event([ir]), Event(evt="key",data="\033"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\x1b', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line548, intest_umlaut_a_germanself.assertEqual(self.get_event([ir]), Event("key",""))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='�', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line517, intest_m_RIGHT_ALT_PRESSEDself.assertEqual(self.get_event([ir]), Event(evt="key",data="\033"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\x1b', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line543, intest_AltGr_mself.assertEqual(self.get_event([ir]), Event("key",""))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='�', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line443, intest_backspaceself.assertEqual(~~~~~~~~~~~~~~~~^self.get_event([ir]), Event("key","backspace"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='backspace', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line473, intest_left_LEFT_CTRL_PRESSEDself.assertEqual(~~~~~~~~~~~~~~~~^self.get_event([ir]), Event("key","ctrl left"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='ctrl left', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line480, intest_left_RIGHT_ALT_PRESSEDself.assertEqual(self.get_event([ir]), Event(evt="key",data="\033"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\x1b', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line460, intest_leftself.assertEqual(self.get_event([ir]), Event("key","left"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='left', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line434, intest_unhandled_eventsself.assertEqual(self.mock.call_count,1)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:0 != 1Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line438, intest_enterself.assertEqual(self.get_event([ir]), Event("key","\n"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\n', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line407, intest_EmptyBufferself.assertEqual(self.mock.call_count,1)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:0 != 1Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line490, intest_left_LEFT_ALT_PRESSEDself.assertEqual(self.get_event([ir]), Event(evt="key",data="\033"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\x1b', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line574, intest_up_vtself.assertEqual(self.get_event(irs,vt_support=True),~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                     Event(evt='key',data='up',raw=bytearray(b'\x1b[A')))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='up', raw=bytearray(b'\x1b[A'))Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line505, intest_m_LEFT_ALT_PRESSED_and_LEFT_CTRL_PRESSEDself.assertEqual(self.mock.call_count,1)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:0 != 1Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line568, intest_backspace_vtself.assertEqual(self.get_event([ir],vt_support=True),~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                     Event("key","backspace",b"\x7f"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='backspace', raw=b'\x7f')Traceback (most recent call last):  File"D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line424, intest_KEY_EVENT_up_ignoredself.assertEqual(self.mock.call_count,1)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:0 != 1

@ambv
Copy link
Contributor

@chris-eibl this buildbot failure ^^^ is real. I can't explain that yet and cannot reproduce it locally on Win 11, but if I don't manage to fix it before tomorrow's 3.14 beta 2, I will have to revert the backport.

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 Windows10 3.14 (tier-1) has failed when building commit93aee56.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1711/builds/99) and take a look at the build logs.
  4. Check if the failure is related to this commit (93aee56) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1711/builds/99

Failed tests:

  • test_pyrepl

Failed subtests:

  • test_up_vt - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_up_vt
  • test_left - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left
  • test_KEY_EVENT_up_ignored - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_KEY_EVENT_up_ignored
  • test_enter_vt - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_enter_vt
  • test_m_LEFT_ALT_PRESSED_and_LEFT_CTRL_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_m_LEFT_ALT_PRESSED_and_LEFT_CTRL_PRESSED
  • test_WINDOW_BUFFER_SIZE_EVENT - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_WINDOW_BUFFER_SIZE_EVENT
  • test_backspace_vt - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_backspace_vt
  • test_left_RIGHT_CTRL_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left_RIGHT_CTRL_PRESSED
  • test_AltGr_m - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_AltGr_m
  • test_EmptyBuffer - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_EmptyBuffer
  • test_unhandled_events - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_unhandled_events
  • test_left_RIGHT_ALT_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left_RIGHT_ALT_PRESSED
  • test_AltGr_7 - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_AltGr_7
  • test_m_LEFT_ALT_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_m_LEFT_ALT_PRESSED
  • test_backspace - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_backspace
  • test_enter - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_enter
  • test_M - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_M
  • test_m - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_m
  • test_umlaut_a_german - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_umlaut_a_german
  • test_left_LEFT_ALT_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left_LEFT_ALT_PRESSED
  • test_left_LEFT_CTRL_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_left_LEFT_CTRL_PRESSED
  • test_m_RIGHT_ALT_PRESSED - test.test_pyrepl.test_windows_console.WindowsConsoleGetEventTests.test_m_RIGHT_ALT_PRESSED

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line466, intest_left_RIGHT_CTRL_PRESSEDself.assertEqual(~~~~~~~~~~~~~~~~^self.get_event([ir]), Event("key","ctrl left"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='ctrl left', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line449, intest_mself.assertEqual(self.get_event([ir]), Event("key","m"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='m', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line480, intest_left_RIGHT_ALT_PRESSEDself.assertEqual(self.get_event([ir]), Event(evt="key",data="\033"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\x1b', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line473, intest_left_LEFT_CTRL_PRESSEDself.assertEqual(~~~~~~~~~~~~~~~~^self.get_event([ir]), Event("key","ctrl left"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='ctrl left', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line407, intest_EmptyBufferself.assertEqual(self.mock.call_count,1)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:0 != 1Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line454, intest_Mself.assertEqual(self.get_event([ir]), Event("key","M"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='M', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line438, intest_enterself.assertEqual(self.get_event([ir]), Event("key","\n"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\n', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line460, intest_leftself.assertEqual(self.get_event([ir]), Event("key","left"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='left', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line424, intest_KEY_EVENT_up_ignoredself.assertEqual(self.mock.call_count,1)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:0 != 1Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line568, intest_backspace_vtself.assertEqual(self.get_event([ir],vt_support=True),~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                     Event("key","backspace",b"\x7f"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='backspace', raw=b'\x7f')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line534, intest_AltGr_7self.assertEqual(self.get_event([ir]), Event("key","{"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='{', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line510, intest_m_LEFT_ALT_PRESSEDself.assertEqual(self.get_event([ir]), Event(evt="key",data="\033"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\x1b', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line548, intest_umlaut_a_germanself.assertEqual(self.get_event([ir]), Event("key",""))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='�', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line415, intest_WINDOW_BUFFER_SIZE_EVENTself.assertEqual(self.get_event([ir]), Event("resize",""))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='resize', data='', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line543, intest_AltGr_mself.assertEqual(self.get_event([ir]), Event("key",""))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='�', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line574, intest_up_vtself.assertEqual(self.get_event(irs,vt_support=True),~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                     Event(evt='key',data='up',raw=bytearray(b'\x1b[A')))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='up', raw=bytearray(b'\x1b[A'))Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line434, intest_unhandled_eventsself.assertEqual(self.mock.call_count,1)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:0 != 1Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line517, intest_m_RIGHT_ALT_PRESSEDself.assertEqual(self.get_event([ir]), Event(evt="key",data="\033"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\x1b', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line490, intest_left_LEFT_ALT_PRESSEDself.assertEqual(self.get_event([ir]), Event(evt="key",data="\033"))~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\x1b', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line505, intest_m_LEFT_ALT_PRESSED_and_LEFT_CTRL_PRESSEDself.assertEqual(self.mock.call_count,1)~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:0 != 1Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line443, intest_backspaceself.assertEqual(~~~~~~~~~~~~~~~~^self.get_event([ir]), Event("key","backspace"))^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='backspace', raw=b'')Traceback (most recent call last):  File"D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line562, intest_enter_vtself.assertEqual(self.get_event([ir],vt_support=True),~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                     Event("key","\n"))^^^^^^^^^^^^^^^^^^^AssertionError:None != Event(evt='key', data='\n', raw=b'')

@chris-eibl
Copy link
MemberAuthor

chris-eibl commentedMay 25, 2025
edited
Loading

I can reproduce these failures on Windows 10, too, for both main and 3.14 when running in a legacy console. In fact, the fix is simple:

--- a/Lib/test/test_pyrepl/test_windows_console.py+++ b/Lib/test/test_pyrepl/test_windows_console.py@@ -386,6 +386,7 @@ def get_event(self, input_records, **kwargs) -> Console:         self.console._read_input = self.mock         self.console._WindowsConsole__vt_support = kwargs.get("vt_support",                                                               False)+        self.console.wait = MagicMock(return_value=True)

in these tests I've introduced in#132439. They shouldn't depend onwait, which was moved in this PR intoget_event. ParticularyWaitForSingleObject(InHandle) is no good here, and I just wonder now, why they pass when the tests are run in a Windows terminal.

I must have run the tests back then in a Windows terminal, and most probably all the GH bots are Windows 11 based, too?

@chris-eibl
Copy link
MemberAuthor

Do you want me to create a PR or is the above diff sufficient?

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 25, 2025
pythongh-134660)(cherry picked from commit1000283)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
ambv pushed a commit that referenced this pull requestMay 25, 2025
…-134660) (gh-134666)(cherry picked from commit1000283)Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
@chris-eiblchris-eibl deleted the speedup_paste_legacy branchMay 26, 2025 05:55
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ambvambvambv approved these changes

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@chris-eibl@bedevere-bot@ambv

[8]ページ先頭

©2009-2025 Movatter.jp