-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-45445: Fail if an invalid X-option is provided in the command line #28823
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
Changes from 1 commit
4b7ea77
33bf9dc
20dd756
ceedd70
19598b5
dfd3e3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…line
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2121,6 +2121,10 @@ _PyConfig_InitImportConfig(PyConfig *config) | |
return config_init_import(config, 1); | ||
} | ||
|
||
// List of known xoptions to validate against the provided ones. Note that all | ||
// options are listed, even if they are only available if a specific macro is | ||
// set, like -X showrefcount which requires a debug build. In this case unknown | ||
// options are silently ignored. | ||
const wchar_t* known_xoptions[] = { | ||
L"faulthandler", | ||
L"showrefcount", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should Python ignore silently this option if Python is not build with Py_REF_DEBUG? Or should we add IMO the least surprising behavior is to ignore silently the option. So leave the code as it is. |
||
|
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.
Would you mind to add a comment saying that all options are listed, even if they are only available if a specific macro is set, like -X showrefcount which requires a debug build (Py_REF_DEBUG). Say that unknown options are silently ignored in this case.
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.
Thanks!