Skip to content

Only execute Python interpreters #536

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

Merged
merged 1 commit into from
Apr 24, 2025
Merged

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Apr 17, 2025

Fixes #535

This checks if the interpreter is anything with python or pypy in it.

Thus, avoiding executing e.g. php -m argcomplete._check_console_script ... (which succeeds).

Fixes kislyuk#535

This checks if the interpreter is anything with python or pypy in it.

Thus, avoiding executing e.g. `php -m argcomplete._check_console_script ...`
(which succeeds).
@hroncok
Copy link
Contributor Author

hroncok commented Apr 17, 2025

I can attempt to write a test for this, however, not today.

@kislyuk kislyuk merged commit 0f0797b into kislyuk:main Apr 24, 2025
23 of 30 checks passed
@kislyuk
Copy link
Owner

kislyuk commented Apr 24, 2025

Thank you!

@hroncok hroncok deleted the python_shebangs_only branch April 24, 2025 15:48
@hroncok
Copy link
Contributor Author

hroncok commented Apr 24, 2025

I can attempt to write a test for this, however, not today.

I attempted to create a script with a shebang that passes even with the -m flag and succeeds.

#!/usr/bin/env echo

Such script can then be used like this:

    def test_foreign_scripts_not_broken(self):
        self.sh.run_command("cd " + TEST_DIR)
        self.sh.run_command("complete -W 'hello' echoer")
        self.sh.run_command(TestBashZshGlobalBase.install_cmd)
        self.assertTrue(self.sh.run_command("echoer h\t").endswith("echoer hello\r\n"))

However, I am not able to make it fail without the fix, so it is not useful as a test :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

global bash completion breaks completion for some PHP scripts
2 participants