sc0ty / subsync

Subtitle Speech Synchronizer
GNU General Public License v3.0
1.29k stars 53 forks source link

Python 3.10 support #133

Closed Danacus closed 2 years ago

Danacus commented 2 years ago

Recently, python was upgraded to 3.10 on Arch Linux. Since then subsync no longer works and shows the following error.

Slider.SetValue(): argument 1 has unexpected type 'float'

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/subsync/__main__.py", line 73, in gui
    win = MainWin(None, task)
  File "/usr/lib/python3.10/site-packages/subsync/gui/mainwin.py", line 71, in __init__
    self.m_sliderMaxDist.SetValue(settings().windowSize / 60.0)
TypeError: Slider.SetValue(): argument 1 has unexpected type 'float'

I'm guessing this is because of python 3.10, but I'm not sure.

Danacus commented 2 years ago

Casting the value for the slider to an integer fixes the issue, I'll quickly make a PR.

Danacus commented 2 years ago

On second thought, this appears to be an upstream issue in wxPython. See https://github.com/wxWidgets/Phoenix/issues/2038. So it will probably fix itself in the future and I can close this issue.

Grandfather-Paradox commented 2 years ago

SubSync is still not working as a result of this on Python 3.10. Is waiting for the upstream fix required or can the integer cast fix please be included?

Danacus commented 2 years ago

No point in adding a dirty hack since it's already fixed in wxPython. Just need to wait for the next release of wxPython.

Grandfather-Paradox commented 2 years ago

Since it's been almost 2 months without an update to wxPython, is it possible to implement your temporary fix? It's been painful using the browser version for each file individually. Could always remove it once wxPython is finally updated.

Danacus commented 2 years ago

The easiest way to fix this is to compile the latest version of wxPython and use that. But apparently it's a very large package to compile (over 4GB), so I never bothered.

They have CI that builds wxPython from source daily, you could maybe try installing one of those builds. http://buildbot.wxpython.org/#/

Edit: alternatively you could use a venv with python 3.9.

michpas commented 1 year ago

Issue is still there. Subsync doesnt compile. Maybe a fix on the slider integer?