Sigmmma / binilla

Visual editor for binary structures based on Supyr_Struct. A user can define their own Supyr definitions and use those to load/edit/create new binary structures in an easy to understand visual editor.
MIT License
1 stars 3 forks source link

fix bug where tags can’t be saved on Python 3.9 #33

Closed delan closed 3 years ago

delan commented 3 years ago

Saving a tag on Python 3.9 currently fails with:

Backing up to: 'c:\program files (x86)\steam\steamapps\common\chelan_1\tags\backup\characters\cyborg\cyborg.model_animations'
Traceback (most recent call last):
  File "C:\Users\delan\opt\MEK\mek_lib\binilla\app_window.py", line 1447, in save_tag
    w.save()
  File "C:\Users\delan\opt\MEK\mek_lib\mozzarilla\windows\tag_window.py", line 42, in save
    TagWindow.save(self, **kwargs)
  File "C:\Users\delan\opt\MEK\mek_lib\binilla\windows\tag_window.py", line 664, in save
    raise exception
  File "C:\Users\delan\opt\MEK\mek_lib\binilla\windows\tag_window.py", line 648, in save
    if not save_thread.isAlive():
AttributeError: 'Thread' object has no attribute 'isAlive'

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Program Files\Python39\lib\tkinter\__init__.py", line 1892, in __call__
    return self.func(*args)
  File "C:\Users\delan\opt\MEK\mek_lib\binilla\app_window.py", line 1362, in save
    self.save_tag()
  File "C:\Users\delan\opt\MEK\mek_lib\mozzarilla\app_window.py", line 915, in save_tag
    return Binilla.save_tag(self, tag)
  File "C:\Users\delan\opt\MEK\mek_lib\binilla\app_window.py", line 1453, in save_tag
    raise IOError("Could not save tag.")
OSError: Could not save tag.

This is essentially because Thread.isAlive was renamed to Thread.is_alive. The new name was added in Python 2.6, then the old name was removed from the docs in Python 3.0, then it was removed entirely in Python 3.9. Thankfully that means our minimum of Python 3.5 won’t need to change.

ShellyHerself commented 3 years ago

Hello there,

Thank you for your contribution. We've been in low maintenance mode because of the original author leaving and the current devs being rather busy. Every bit of help is appreciated!

Our minimum version for Python actually has been 3.6 for a while because of our usage of pathlib. So, any reference to 3.5 is incorrect. There was a lot of references to it though, so we definitely have missed a few of them.

I'll push a new version to PyPi so people can use this fix.