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

ui: fix progress bar on python 3.10+ #532

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Conversation

karlp
Copy link
Contributor

@karlp karlp commented Sep 14, 2022

Apparently python 3.10 no longer silently truncates floats to ints, (see python/cpython#82180)

Current code passes a float to the wxGauge progress bar, which then prints (not) tracebacks like:

TypeError: Gauge.SetValue(): argument 1 has unexpected type 'float' Traceback (most recent call last):
File "/usr/lib64/python3.10/site-packages/wx/core.py", line 3285, in
lambda event: event.callable(*event.args, **event.kw) )

At least someone is catching and ignoring the exception, so the app works, just the progress bar is broken.

It just needs to be explicitly forced to an int to make it work again

Signed-off-by: Karl Palsson karlp@etactica.com

Apparently python 3.10 no longer silently truncates floats to ints,
(see python/cpython#82180)

Current code passes a float to the wxGauge progress bar, which then
prints (not) tracebacks like:

TypeError: Gauge.SetValue(): argument 1 has unexpected type 'float'
Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/wx/core.py", line 3285, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )

At least someone is catching and ignoring the exception, so the app
works, just the progress bar is broken.

It just needs to be explicitly forced to an int to make it work again

Signed-off-by: Karl Palsson <karlp@etactica.com>
@karlp
Copy link
Contributor Author

karlp commented Sep 14, 2022

So, the "cancelled" runs, no idea. the failing checks are completely outside my code.
The flake validation errors have been in the code since at least 3343eff in 2017 (edas/tools.py) and 8c11dc8 in 2021 (spreadsheet.py). Kinda hard to take your checks seriously. Are you just ignoring them every single time?! It's been suggested that you've probably been hit with a flake update on the test runner that has added new validations, so I was likely being unfair earlier, my apologies.

@set-soft set-soft merged commit 91d6f17 into hildogjr:master Sep 27, 2022
@set-soft
Copy link
Collaborator

It's been suggested that you've probably been hit with a flake update on the test runner that has added new validations
Yes, in my system flake is:

$ flake8 --version
3.8.4 (mccabe: 0.6.1, pycodestyle: 2.6.0, pyflakes: 2.2.0) CPython 3.9.2 on Linux

And it doesn't point any problem at not(...)

@karlp karlp deleted the py310-compat branch September 27, 2022 15:48
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

Successfully merging this pull request may close these issues.

2 participants