Skip to content

Wrong way of comparing versions #82

@cgosorio

Description

@cgosorio

The way the code is comparing versions is wrong and could cause error in systems with old versions of Chrome (in my case, the Chrome version that caused the problem was 91.0.4472.114). As the code is comparing strings rather than numbers the comparison "91" >= "115" gives True, when actually we should be comparing 91>=115 to get the False value.

The comparison:

get_major_version(chrome_version) >= "115"

should be changed to:

int(get_major_version(chrome_version)) >= 115

in the following lines:

The comparison:

get_major_version(chromedriver_version) >= "115"

should be changed to:

int(get_major_version(chromedriver_version)) >= 115

in line:

if get_major_version(chromedriver_version) >= "115": # new CfT ChromeDriver versions have their URLs published, so we already have a list of options

And finally, the comparison:

major_version >= "115"

should be changed to:

int(major_version) >= 115

in line:

if not chromedriver_version or (major_version >= "115" and not download_options):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions