Skip to main content
Topic: gpodder extras : edit-file-temporary-fix after python 3.11 to 3.12 (Read 152 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

gpodder extras : edit-file-temporary-fix after python 3.11 to 3.12

In case this is useful... This seems to fix gpodder, after limited testing, and after the recent Arch/Artix python update from 3.11 to 3.12. A temporary fix while while waiting for an official update from the upstream project and package maintainer...

https://github.com/gpodder/gpodder/commit/dd9b594d24a541c0f1d3b096e47b6d7f1c11ca7e

https://github.com/gpodder/gpodder/issues/1614

In case this helps anyone using this great podcast application on Artix...

==

# diff /usr/lib/python3.12/site-packages/gpodder/extensions.py /usr/lib/python3.12/site-packages/gpodder/extensions.py.orig
34c34
< import importlib
---
> import imp
294c294,295
<    basename, _ = os.path.splitext(os.path.basename(self.filename))
---
>         basename, extension = os.path.splitext(os.path.basename(self.filename))
>         fp = open(self.filename, 'r')
296,300c297,298
<             # from load_source() on https://docs.python.org/dev/whatsnew/3.12.html
<             loader = importlib.machinery.SourceFileLoader(basename, self.filename)
<             spec = importlib.util.spec_from_file_location(basename, self.filename, loader=loader)
<             module_file = importlib.util.module_from_spec(spec)
<             loader.exec_module(module_file)
---
>             module_file = imp.load_module(basename, fp, self.filename,
>                     (extension, 'r', imp.PY_SOURCE))
303a302
>         fp.close()
#