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-134064: Fix sys.remote_exec() error checking#134067

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
vstinner merged 1 commit intopython:mainfromvstinner:remote_exec
May 17, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-134064: Fix sys.remote_exec() error checking
  • Loading branch information
@vstinner
vstinner committedMay 15, 2025
commita14dd2e94d5d66b49fc85d09a517bc57bfe989a9
7 changes: 7 additions & 0 deletionsLib/test/test_sys.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2176,6 +2176,13 @@ def test_remote_exec_invalid_pid(self):
withself.assertRaises(OSError):
sys.remote_exec(99999,"print('should not run')")

deftest_remote_exec_invalid_script(self):
"""Test remote exec with invalid script type"""
withself.assertRaises(TypeError):
sys.remote_exec(0,None)
withself.assertRaises(TypeError):
sys.remote_exec(0,123)

deftest_remote_exec_syntax_error(self):
"""Test remote exec with syntax error in script"""
script='''
Expand Down
2 changes: 1 addition & 1 deletionPython/sysmodule.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2485,7 +2485,7 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
PyObject *path;
const char *debugger_script_path;

if (PyUnicode_FSConverter(script, &path)< 0) {
if (PyUnicode_FSConverter(script, &path)== 0) {
return NULL;
}
debugger_script_path = PyBytes_AS_STRING(path);
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp