Kezyma / ModOrganizer-Plugins

Plugins for Mod Organizer 2.
55 stars 18 forks source link

[Bug] Update removed functions for Python 3.12 #36

Closed ZashIn closed 2 months ago

ZashIn commented 3 months ago

ModOrganizer 2.5.2 switched to Python 3.12, which removed some deprecated functions, including Path.link_to(), which has been deprecated since Python 3.10. So hard links are probably not working anymore in MO 2.5.2.

So Path.link_to() has to be replaced by Path.hardlink_to().

ZashIn commented 2 months ago

So all your plugins are supposed to be compatible with both MO 2.4 and 2.5? So targeting Python 3.8, 3.11 and 3.12? That would mean adding compatibility wrappers for deprecated functions from 3.11 and 3.12. Not sure if anything else besides Path.link_to() is effected.

For the patch in common_utilities.py:

Kezyma commented 2 months ago

The retries in there were added in an attempt to fix some of the issues with profile sync randomly breaking and then never getting triggered again, but due to the inconsistency of the bug it's almost impossible to figure out if it's helped or not.

I was going to try and implement some kind of queue system to handle file operations for it, but limited time and the complexity of figuring it out meant that I simply haven't gotten around to it.