Skip to content

Conversation

@chris-eibl
Copy link
Member

@chris-eiblchris-eibl commented Apr 24, 2025

This is on top of #132884. So reviews should be done beginning with commit a64f4c4.

"""Return the characters that have been typed but not yet
processed."""
returnEvent("key", "", b"")
e=Event("key", "", b"")
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I've just copy-pasted this from

defgetpending(self):
"""
Get pending events from the console event queue.
Returns:
- Event: Pending event from the event queue.
"""
e=Event("key", "", b"")
whilenotself.event_queue.empty():
e2=self.event_queue.get()
e.data+=e2.data
e.raw+=e.raw
amount=10000
raw=self.__read(amount)
data=str(raw, self.encoding, "replace")
e.data+=data
e.raw+=raw
returne

and dropped the reading of the next chunk, since IMHO this does not fit the doc string.

mypy fires here

Lib/_pyrepl/windows_console.py:545: error: Item "None" of "Event | None" has no attribute "data" [union-attr] e.data += e2.data ^~~~~~~ Found 1 error in 1 file (checked 25 source files) 

and is indeed correct. Have to dig in why we do not see this in case of unix_console.py ...

@chris-eiblchris-eibl added OS-windows topic-repl Related to the interactive shell labels Apr 24, 2025
returnFalse
returnTrue

defwait(self, timeout: float|None=None) ->bool:
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Full in sync with unix_console.py now :)

defwait(self, timeout: float|None=None) ->bool:
"""
Wait for events on the console.
"""
return (
notself.event_queue.empty()
orself.more_in_buffer()
orbool(self.pollob.poll(timeout))
)

to use self.paste_mode instead of self.in_bracketed_paste in class Reader
to revert "use self.paste_mode instead of self.in_bracketed_paste"
# Conflicts: # Lib/_pyrepl/windows_console.py
it isn't used in the whole code, and some code paths in WindowsConsole set it to str instead of bytes
@chris-eibl
Copy link
MemberAuthor

Closed because superseded by #133247 (comment).

@chris-eiblchris-eibl deleted the read_chunked branch May 6, 2025 04:06
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviewOS-windowstopic-replRelated to the interactive shell

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@chris-eibl