lilydjwg/nvchecker

After `nvtake myprogram=1.0.0`, the next invocation of nvchecker crashes with a TypeError

Closed this issue · 1 comments

It seems as though nvtake myprogram=1.0.0 and nvchecker disagree on what the format of the old_ver.json should be: a string or an object. The next time I run nvchecker, it cannot parse the version, and instead crashes with a TypeError.

Steps

Note: Neither old_ver.json nor new_ver.json exist at this point.

  1. My ~/.config/nvchecker/nvchecker.toml:
[__config__]
oldver = "old_ver.json"
newver = "new_ver.json"

[linux]
source = "github"
github = "torvalds/linux"
  1. nvchecker

[I 05-24 00:39:10.933 core:408] linux: updated to 20240523.205109 taskName=Task-2 url=https://github.com/torvalds/linux/commit/6d69b6c12fce479fde7bc06f686212451688a102

  1. nvtake linux=20240523.205109
  2. nvchecker
Traceback (most recent call last):
  File "/usr/bin/nvchecker", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/nvchecker/__main__.py", line 75, in main
    oldvers = core.read_verfile(options.ver_files[0])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/nvchecker/core.py", line 149, in read_verfile
    v = {k: RichResult(**a) for k, a in v['data'].items()}
            ^^^^^^^^^^^^^^^
TypeError: nvchecker.util.RichResult() argument after ** must be a mapping, not str
sys:1: RuntimeWarning: coroutine 'BaseWorker._run_maynot_raise' was never awaited

Other notes

I have installed nvchecker from Arch Linux repos, but I can also reproduce this with a venv, installed this way.

python -m venv ~/nvchecker-venv
cd ~/nvchecker-venv
source ./bin/activate
pip install nvchecker
# work around cert location issue with bundled libcurl.so... shrug
pip uninstall pycurl
pip install pycurl --no-binary :all:

Both are using release v2.14.1.

Thanks. It's fixed, and you can edit your oldver file to remove the bad data to recover.