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

Commiteaee2ae

Browse files
[3.14]gh-134064: Fix sys.remote_exec() error checking (GH-134067) (#134162)
gh-134064: Fix sys.remote_exec() error checking (GH-134067)(cherry picked from commit009e7b3)Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent1ba5e65 commiteaee2ae

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

‎Lib/test/test_sys.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,13 @@ def test_remote_exec_invalid_pid(self):
21762176
withself.assertRaises(OSError):
21772177
sys.remote_exec(99999,"print('should not run')")
21782178

2179+
deftest_remote_exec_invalid_script(self):
2180+
"""Test remote exec with invalid script type"""
2181+
withself.assertRaises(TypeError):
2182+
sys.remote_exec(0,None)
2183+
withself.assertRaises(TypeError):
2184+
sys.remote_exec(0,123)
2185+
21792186
deftest_remote_exec_syntax_error(self):
21802187
"""Test remote exec with syntax error in script"""
21812188
script='''

‎Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,7 +2484,7 @@ sys_remote_exec_impl(PyObject *module, int pid, PyObject *script)
24842484
PyObject*path;
24852485
constchar*debugger_script_path;
24862486

2487-
if (PyUnicode_FSConverter(script,&path)<0) {
2487+
if (PyUnicode_FSConverter(script,&path)==0) {
24882488
returnNULL;
24892489
}
24902490
debugger_script_path=PyBytes_AS_STRING(path);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp