Skip to content
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

Fix Boolean Conversion Issue from Shell to Python #1792

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

yfyeung
Copy link
Collaborator

@yfyeung yfyeung commented Oct 30, 2024

Fixes a bug where the shell variable with a False value is passed to Python as a string, causing bool("False") to evaluate as True.

@yfyeung
Copy link
Collaborator Author

yfyeung commented Oct 30, 2024

For example:

test.py:

import sys
print(type(sys.argv[1]))
python test.py False

Output:

<class 'str'>

Copy link
Collaborator

@csukuangfj csukuangfj left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

@JinZr JinZr merged commit 119e1ce into k2-fsa:master Oct 31, 2024
112 of 123 checks passed
@yfyeung yfyeung deleted the fix/str2bool branch October 31, 2024 03:01
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.

3 participants