Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Modules args parser does not accept parameters with numbers #1867

@isaacag

Description

@isaacag

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions