Skip to content

Modules args parser does not accept parameters with numbers #1867

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

Closed
isaacag opened this issue Oct 7, 2024 · 1 comment · Fixed by #1868
Closed

Modules args parser does not accept parameters with numbers #1867

isaacag opened this issue Oct 7, 2024 · 1 comment · Fixed by #1868
Labels

Comments

@isaacag
Copy link

isaacag commented Oct 7, 2024

Describe the bug

This line contains a regex that will fail to parse arguments containing numbers.
if not re.match(r"^--[a-zA-Z-]?=\S?$", arg):
Producing errors like:
ValueError: Parsing argument --tseg1-abr=127 failed.

To Reproduce

python -m can.viewer -c 0 -i vector -b 500000 --fd --data_bitrate 2000000 --sjw-abr=32 --tseg1-abr=127 --tseg2-abr=32 --sjw-dbr=8 --tseg1-dbr=31 --tseg2-dbr=8

Expected behavior

Extra args values are accepted.

Additional context

OS and version: Windows 10 Pro
Python version: 3.12
python-can version: 4.4.2
python-can interface/s (if applicable): vector

@zariiii9003
Copy link
Collaborator

Thanks for the report, it should be fixed on main branch now. Could you also try #1869 ? I implemented a --timing parameter a few months ago and forgot about it.

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

Successfully merging a pull request may close this issue.

2 participants