Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HackRF One TypeError Unexpected Type #101

Open
ThreeCalories opened this issue Aug 13, 2022 · 1 comment
Open

HackRF One TypeError Unexpected Type #101

ThreeCalories opened this issue Aug 13, 2022 · 1 comment

Comments

@ThreeCalories
Copy link

ThreeCalories commented Aug 13, 2022

When I attempt to run hackrf_sweep I get a TypeError unexpected 'float' type.

QSocketNotifier: Can only be used with threads started with QThread
Traceback (most recent call last):
  File "/home/threecalories/.local/lib/python3.10/site-packages/qspectrumanalyzer/__main__.py", line 368, in on_startButton_clicked
    self.start()
  File "/home/threecalories/.local/lib/python3.10/site-packages/qspectrumanalyzer/__main__.py", line 303, in start
    self.progressbar.setRange(0, self.intervalSpinBox.value() * 1000)
TypeError: setRange(self, int, int): argument 2 has unexpected type 'float'

Any help resolving this would be much appreciated.

@courtarro
Copy link

courtarro commented Dec 5, 2022

Not the developer, but this looks related to issues in how Python 3.10 handles float and int types. The literal 1000 is obviously an int, but even though self.intervalSpinBox.value() should always be an int, maybe Python is returning a float for that? Otherwise I guess the workaround is to wrap int:

int(self.intervalSpinBox.value() * 1000)

Or if you have Python 3.9 give that a shot. See also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants