amogorkon/justuse

invalid literal for int() with base 16: 'Y復㝿浯䨩䩯鷛㬉鼵爔滥哫鷕 逮 愁墕萮緩' (spaces in hashes)

Closed this issue · 1 comments

First I did:

>>> use("package-example", version="0.1", modes=use.use.auto_install)

output was:

>>> INFO: use.main: case = (True, False, False, True)
DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): pypi.org:443
DEBUG: urllib3.connectionpool: https://pypi.org:443 "GET /pypi/package-example/json HTTP/1.1" 200 750
...
`use("package-example", version="0.1", hashes={'Y復㝿浯䨩䩯鷛㬉鼵爔滥哫鷕逮 愁墕萮緩'}, modes=use.auto_install)`

So then, upon running the suggestion, I get:

>>> use("package-example", version="0.1", hashes={'Y復㝿浯䨩䩯鷛㬉鼵爔滥哫鷕逮 愁墕萮緩'}, modes=use.auto_install)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/media/0/src/use/src/src/use/main.py", line 118, in __call__
    return self.__implementation(*args, **kwargs)
  File "/data/media/0/src/use/src/src/use/tools.py", line 46, in wrapper
    return dispatcher.dispatch(args[1].__class__)(*args, **kwargs)
  File "/data/media/0/src/use/src/src/use/main.py", line 704, in _use_str
    return self._use_package(
  File "/usr/local/lib/python3.9/dist-packages/icontract/_checkers.py", line 641, in wrapper
    result = func(*args, **kwargs)
  File "/data/media/0/src/use/src/src/use/main.py", line 743, in _use_package
    hashes: set[int] = {JACK_as_num(H) if is_JACK(H) else int(H, 16) for H in hashes}
  File "/data/media/0/src/use/src/src/use/main.py", line 743, in <setcomp>
    hashes: set[int] = {JACK_as_num(H) if is_JACK(H) else int(H, 16) for H in hashes}
ValueError: invalid literal for int() with base 16: 'Y復㝿浯䨩䩯鷛㬉鼵爔滥哫鷕 逮 愁墕萮緩'

Hmmm.. I get a different issue unrelated to this one. However, when I compare the hash I got with the one you posted, I'm noticing spaces in yours. I think this is the actual issue. I'm stripping user-input hashes to avoid issues like this now.