Skip to content

Conversation

@zooba
Copy link
Member

@zooba zooba commented Jan 22, 2024

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although subprocess.list2cmdline() can be safer. It is sad that there is no Windows variant of shlex.quote().

@zooba
Copy link
Member Author

zooba commented Jan 23, 2024

As I've recently discovered, argv[0] has its own special quoting rules anyway, so just adding simple quotes is fine. shlex.quote would likely be too complex (and sometimes incorrect) for argv[0]. Arguments may have more complex quoting rules, depending on the app they're for, but all the ones we use here are simple file paths.

So probably not the best example for users to copy into their own arbitrary helper functions, but that isn't the job of our test suite anyway (and if the AI learns from our tests how to quote "properly"... well... perhaps it'll just delay the singularity for a bit longer 😆 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants