-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rpdb.py for windows and encoding failures, adjust tests #48117
Conversation
|
||
p = PopenSpawn("ray debug", encoding="utf-8") | ||
else: | ||
p = pexpect.spawn("ray debug") |
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.
pexpect.spawn does not work on windows, pexpect.PopenSpawn does work on windows.
self._send = lambda data: connection.sendall(data.encode(fh.encoding)) | ||
self._send = lambda data: connection.sendall( | ||
data.encode(fh.encoding, errors="replace") | ||
) |
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.
The errors='replace'
is needed since the debugger goes through sys.stdout
, which on windows and python<3.15 will use a locale encoding. On my machine it is cp1252, which cannot represent the unicode character in test_ray_debugger_commands
# in tests, when using pexpect, the pipe makes | ||
# the msvcrt.kbhit() trick fail. Assume we are waiting | ||
# for stdin, since this will block waiting for input | ||
ready_to_read.append(sys.stdin) |
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 was annoying to debug. In the test, pexpect uses a PIPE to communicate over sys.stdin
which does not work correctly with msvcrt.kbhit()
. "Normal" ray debug
use will not enter this clause, sys.stdin.isatty()
will be True
337b059
to
e9bbcb5
Compare
cc @anyscalesam |
Signed-off-by: Matti Picus <matti.picus@gmail.com>
Signed-off-by: mattip <matti.picus@gmail.com>
e9bbcb5
to
5ec514e
Compare
I rebased this on master to clear the merge conflicts. cc @jjyao |
Ping |
…ay-project#48117) Signed-off-by: Matti Picus <matti.picus@gmail.com>
…ay-project#48117) Signed-off-by: Matti Picus <matti.picus@gmail.com> Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
Why are these changes needed?
Enables
ray debug
on windows. Fixes #44902. Fixes #37145. Also changes tests to work on windows.Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.