Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-133886: Fix sys.remote_exec() for non-UTF-8 paths#133887
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
gh-133886: Fix sys.remote_exec() for non-UTF-8 paths#133887
Uh oh!
There was an error while loading.Please reload this page.
Conversation
It now supports non-ASCII paths in non-UTF-8 locales andnon-UTF-8 paths in UTF-8 locales.
45e4604
tobd30460
Comparerun_remote_debugger_script(path); | ||
PyObject *path_obj = PyUnicode_DecodeFSDefault(path); | ||
if (path_obj == NULL) { | ||
PyErr_FormatUnraisable("Can't decode debugger script"); |
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.
Can we include the script path in this exception ?
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.
LGTM
Left a suggestion
'undecodable paths are not supported on macOS') | ||
def test_remote_exec_undecodable(self): | ||
script = 'print("Remote script executed successfully!")' | ||
script_path = os_helper.TESTFN_UNDECODABLE + b'_undecodable_remote.py' |
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.
Oh nice! I didn't know about this
Python/sysmodule.c Outdated
} | ||
Py_DECREF(path); |
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.
Maybe we can have a goto label for the error at this stage. I don't mind either way so up to you
c09cec5
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
GH-133963 is a backport of this pull request to the3.14 branch. |
Thank you for your review,@pablogsal. |
We could also use natural UTF-16 for paths on Windows, but this is more significant change. |
Uh oh!
There was an error while loading.Please reload this page.
It now supports non-ASCII paths in non-UTF-8 locales and non-UTF-8 paths in UTF-8 locales.