Skip to content

problem with semver compare #60

@michalbagrowski

Description

@michalbagrowski

semver is returning error with semver.compare with values:

VersionInfo(major=1, minor=9, patch=1, prerelease='1unms', build=None)
>>> semver.parse_version_info("1.9.1+1")
VersionInfo(major=1, minor=9, patch=1, prerelease=None, build='1')
>>> semver.compare("1.9.1-1unms","1.9.1+1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/acid/Projects/firmware-update/.virtualenv/lib/python3.6/site-packages/semver.py", line 189, in compare
    return _compare_by_keys(v1, v2)
  File "/Users/acid/Projects/firmware-update/.virtualenv/lib/python3.6/site-packages/semver.py", line 165, in _compare_by_keys
    rccmp = _nat_cmp(rc1, rc2)
  File "/Users/acid/Projects/firmware-update/.virtualenv/lib/python3.6/site-packages/semver.py", line 149, in _nat_cmp
    a_parts, b_parts = split_key(a), split_key(b)
  File "/Users/acid/Projects/firmware-update/.virtualenv/lib/python3.6/site-packages/semver.py", line 136, in split_key
    return [convert(c) for c in key.split('.')]
  File "/Users/acid/Projects/firmware-update/.virtualenv/lib/python3.6/site-packages/semver.py", line 136, in <listcomp>
    return [convert(c) for c in key.split('.')]
  File "/Users/acid/Projects/firmware-update/.virtualenv/lib/python3.6/site-packages/semver.py", line 133, in convert
    return int(text) if re.match('[0-9]+', text) else text
ValueError: invalid literal for int() with base 10: '1unms'
>>>```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy