GeezerVison is showing github.com — GH-130328: Speedup pasting in legacy console on Windows by chris-eibl · Pull Request #133728 · python/cpython
Conversation
chris-eibl
commented
May 9, 2025
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
recs, rec_count = self._read_input_bulk(1024)
|
|
|
for i in range(rec_count):
|
|
|
rec = recs[i]
|
|
|
# In case of a legacy console, we do not only receive a keydown
|
There was a problem hiding this comment.
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 from get_event now. Maybe refactor that, so the logic can be reused here?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
and there is no event pending, otherwise waits for the
|
|
|
completion of an event."""
|
|
|
|
|
|
if not block and not self.wait(timeout=0):
|
There was a problem hiding this comment.
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 into get_event like in unix_console.py. IMHO that shouldn't be part of reading and we're in perfect sync with Unix now.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ambv reacted with thumbs up emoji
|
|
data = ""
|
|
|
start = time.time()
|
|
|
while done not in data:
|
|
|
self.reader.console.wait(100)
|
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this 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 my getpending() implementation without adding any double-buffering. It is indeed speeding things up dramatically while not breaking the existing bracketed paste behavior.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chris-eibl reacted with heart emoji
|
Thanks @chris-eibl for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 Windows10 3.x (tier-1) has failed when building commit 91b4886.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- 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.
- Check if the failure is related to this commit (91b4886) or if it is a false positive.
- 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:
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", line 415, in test_WINDOW_BUFFER_SIZE_EVENT
self.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", line 466, in test_left_RIGHT_CTRL_PRESSED
self.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", line 534, in test_AltGr_7
self.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", line 454, in test_M
self.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", line 562, in test_enter_vt
self.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", line 449, in test_m
self.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", line 510, in test_m_LEFT_ALT_PRESSED
self.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", line 548, in test_umlaut_a_german
self.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", line 517, in test_m_RIGHT_ALT_PRESSED
self.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", line 543, in test_AltGr_m
self.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", line 443, in test_backspace
self.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", line 473, in test_left_LEFT_CTRL_PRESSED
self.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", line 480, in test_left_RIGHT_ALT_PRESSED
self.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", line 460, in test_left
self.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", line 434, in test_unhandled_events
self.assertEqual(self.mock.call_count, 1)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 1
Traceback (most recent call last):
File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line 438, in test_enter
self.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", line 407, in test_EmptyBuffer
self.assertEqual(self.mock.call_count, 1)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 1
Traceback (most recent call last):
File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line 490, in test_left_LEFT_ALT_PRESSED
self.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", line 574, in test_up_vt
self.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", line 505, in test_m_LEFT_ALT_PRESSED_and_LEFT_CTRL_PRESSED
self.assertEqual(self.mock.call_count, 1)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 1
Traceback (most recent call last):
File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line 568, in test_backspace_vt
self.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", line 424, in test_KEY_EVENT_up_ignored
self.assertEqual(self.mock.call_count, 1)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 1
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 Windows10 3.14 (tier-1) has failed when building commit 93aee56.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- 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.
- Check if the failure is related to this commit (93aee56) or if it is a false positive.
- 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:
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", line 466, in test_left_RIGHT_CTRL_PRESSED
self.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", line 449, in test_m
self.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", line 480, in test_left_RIGHT_ALT_PRESSED
self.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", line 473, in test_left_LEFT_CTRL_PRESSED
self.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", line 407, in test_EmptyBuffer
self.assertEqual(self.mock.call_count, 1)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 1
Traceback (most recent call last):
File "D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line 454, in test_M
self.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", line 438, in test_enter
self.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", line 460, in test_left
self.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", line 424, in test_KEY_EVENT_up_ignored
self.assertEqual(self.mock.call_count, 1)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 1
Traceback (most recent call last):
File "D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line 568, in test_backspace_vt
self.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", line 534, in test_AltGr_7
self.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", line 510, in test_m_LEFT_ALT_PRESSED
self.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", line 548, in test_umlaut_a_german
self.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", line 415, in test_WINDOW_BUFFER_SIZE_EVENT
self.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", line 543, in test_AltGr_m
self.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", line 574, in test_up_vt
self.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", line 434, in test_unhandled_events
self.assertEqual(self.mock.call_count, 1)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 1
Traceback (most recent call last):
File "D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line 517, in test_m_RIGHT_ALT_PRESSED
self.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", line 490, in test_left_LEFT_ALT_PRESSED
self.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", line 505, in test_m_LEFT_ALT_PRESSED_and_LEFT_CTRL_PRESSED
self.assertEqual(self.mock.call_count, 1)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 1
Traceback (most recent call last):
File "D:\buildarea\3.14.bolen-windows10\build\Lib\test\test_pyrepl\test_windows_console.py", line 443, in test_backspace
self.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", line 562, in test_enter_vt
self.assertEqual(self.get_event([ir], vt_support=True),
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Event("key", "\n"))
^^^^^^^^^^^^^^^^^^^
AssertionError: None != Event(evt='key', data='\n', raw=b'')
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chris-eibl
commented
May 25, 2025
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
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 on wait, which was moved in this PR into get_event. Particulary WaitForSingleObject(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?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Do you want me to create a PR or is the above diff sufficient?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|