cryptoadvance / cryptoadvance/specter-desktop

TypeError: 'float' object cannot be interpreted as an integer - Python 3.12

Open
#2,453 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
847
Forks
259
Avg merge
6d 18h
Merged PRs (30d)
2

Description

**Describe the bug**
I have been maintaining an Arch Linux package for Specter Desktop. Arch recently moved to Python 3.12 and I suspect the Python upgrade is responsible for a behavior change in random.py which breaks the run process.

**To Reproduce**
Steps to reproduce the behavior:
Run Specter Desktop with this command on Arch Linux running Python 3.12:
`python -m cryptoadvance.specter server --debug`

**Expected behavior**
Specter Desktop should run normally as it did in Python 3.11 on Arch Linux

**Desktop (please complete the following information):**
- Arch Linux
- Running at Arch Linux CLI
- Specter Version 2.0.5

**Additional context**
Here is the full error message:
$ python -m cryptoadvance.specter server --debug
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/lib/python3.12/site-packages/cryptoadvance/specter/__main__.py", line 2, in
from .cli import entry_point
File "/usr/lib/python3.12/site-packages/cryptoadvance/specter/cli/__init__.py", line 6, in
from ..server import setup_logging
File "/usr/lib/python3.12/site-packages/cryptoadvance/specter/server.py", line 31, in
from .hwi_server import hwi_server
File "/usr/lib/python3.12/site-packages/cryptoadvance/specter/hwi_server.py", line 14, in
rand = random.randint(0, 1e32) # to force style refresh
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/random.py", line 336, in randint
return self.randrange(a, b+1)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/random.py", line 312, in randrange
istop = _index(stop)
^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.