Skip to content

Fix: Change --chrome-version argument type from int to str#51

Draft
mdeweerd wants to merge 1 commit into
meters-to-hafrom
vibe/fix-chrome-version-type-713fd7
Draft

Fix: Change --chrome-version argument type from int to str#51
mdeweerd wants to merge 1 commit into
meters-to-hafrom
vibe/fix-chrome-version-type-713fd7

Conversation

@mdeweerd

Copy link
Copy Markdown
Owner

Issue

When passing a Chrome version string containing a + character (e.g., 123.0.6312.105+), the following error occurred:

meters_to_ha.py: error: argument --chrome-version: invalid int value: + 

Root Cause

The --chrome-version argument was defined with type=int, which cannot parse version strings containing non-numeric characters like +.

Fix

Changed the argument type from int to str to accept Chrome version strings as-is.

Details

  • Chrome version strings are typically in format MAJOR.MINOR.BUILD.PATCH
  • They may contain non-numeric characters like + (e.g., 123.0.6312.105+)
  • The version string is passed to uc.Chrome(version_main=...) which accepts strings

Testing

  • Syntax checked with Python py_compile
  • Manual testing recommended to verify --chrome-version argument works with version strings containing +

The --chrome-version argument was defined with type=int, which caused an error
when the version string contained a '+' character (e.g., '123.0.6312.105+').

Chrome version strings are typically in the format MAJOR.MINOR.BUILD.PATCH and may
contain non-numeric characters like '+'.

Changed type=int to type=str to accept version strings as-is.
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.

2 participants