Skip to content

Fix bug with config check script for native-messaging #578

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakedemian
Copy link

@jakedemian jakedemian commented Feb 12, 2025

Description

The setup instructions for native-messaging are specific to python3. Likewise, ping_pong_win.bat has the command call python3.

call python3 C:\path\to\ping_pong.py

There is a script to ensure you've got everything configured correctly, check_config_win.py. However, in this check script we're checking for the string literal "call python " within the .bat file, which will always evaluate to false due to the trailing space. Due to this, a person could be in a state where everything is actually configured correctly, but the check script incorrectly responds with an error.

This PR changes "call python " to "call python3"` in order to align the check script with the setup instructions.

Motivation

I was trying to get the native messaging example set up on my PC but ran into some confusion when the check script was giving me false negatives

The setup instruction and specific to `python3`, and the `ping_pong_win.bat` has the command `call python3`, however the `check_config_win.py` is checking for the string literal `"call python "` which will always evaluate to false due to the trailing space.
@jakedemian jakedemian changed the title Fix issue with parsing the .bat in check_config_win.py Fix bug with config check script Feb 12, 2025
@jakedemian jakedemian changed the title Fix bug with config check script Fix bug with config check script for native-messaging Feb 12, 2025
@@ -45,7 +45,7 @@
py_lines = open(bat_path, 'r').readlines()
py_path = None
for line in py_lines:
if line.startswith('call python '):
if line.startswith('call python3 '):
Copy link
Author

Choose a reason for hiding this comment

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

This did not previously align with the actual text that is in the .bat:

call python3 C:\path\to\ping_pong.py

@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idle Issues and pull requests with no activity for three months.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant