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

script.module.future python module is incompatible with python 3.12 #25284

Closed
1 of 7 tasks
craftyguy opened this issue May 30, 2024 · 2 comments
Closed
1 of 7 tasks

script.module.future python module is incompatible with python 3.12 #25284

craftyguy opened this issue May 30, 2024 · 2 comments
Labels
Triage: Needed (managed by bot!) issue that was just created and needs someone looking at it

Comments

@craftyguy
Copy link

Bug report

Describe the bug

Addons which use the script.module.future do not work when Kodi is run on a host OS with python 3.12.
This older version of future tries to import the imp module, which was removed in python 3.12. future-1.0.0 fixes this (see PythonCharmers/python-future@a6222d2)

Also see: robweber/xbmcbackup#239

Expected Behavior

Addons using script.module.future should not crash on startup.

Actual Behavior

Addons that use this crash on startup, e.g. with the "backup" addon:

2024-05-30 01:01:19.668 T:26624   error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'ModuleNotFoundError'>
                                                   Error Contents: No module named 'imp'
                                                   Traceback (most recent call last):
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/default.py", line 4, in <module>
                                                       from resources.lib.backup import XbmcBackup
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 10, in <module>
                                                       from . vfs import XBMCFileSystem, DropboxFileSystem, ZipFileSystem
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/resources/lib/vfs.py", line 10, in <module>
                                                       from . authorizers import DropboxAuthorizer
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/resources/lib/authorizers.py", line 5, in <module>
                                                       import resources.lib.tinyurl as tinyurl
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/resources/lib/tinyurl.py", line 3, in <module>
                                                       from future.moves.urllib.request import urlopen
                                                     File "/var/lib/kodi/.kodi/addons/script.module.future/lib/future/moves/__init__.py", line 5, in <module>
                                                       from future.standard_library import import_top_level_modules
                                                     File "/var/lib/kodi/.kodi/addons/script.module.future/lib/future/standard_library/__init__.py", line 65, in <module>
                                                       import imp
                                                   ModuleNotFoundError: No module named 'imp'
                                                   -->End of Python script error report<--

Possible Fix

Kodi(?) should include the future >=1.0.0, that supports Python 3.12

To Reproduce

Steps to reproduce the behavior:

  1. Install an addon that uses script.module.future on Omega
  2. Run the addon, observe crash in log

Debuglog

The debuglog can be found here:

output in log when addon crashes
2024-05-30 01:01:19.668 T:26624   error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'ModuleNotFoundError'>
                                                   Error Contents: No module named 'imp'
                                                   Traceback (most recent call last):
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/default.py", line 4, in <module>
                                                       from resources.lib.backup import XbmcBackup
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 10, in <module>
                                                       from . vfs import XBMCFileSystem, DropboxFileSystem, ZipFileSystem
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/resources/lib/vfs.py", line 10, in <module>
                                                       from . authorizers import DropboxAuthorizer
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/resources/lib/authorizers.py", line 5, in <module>
                                                       import resources.lib.tinyurl as tinyurl
                                                     File "/var/lib/kodi/.kodi/addons/script.xbmcbackup/resources/lib/tinyurl.py", line 3, in <module>
                                                       from future.moves.urllib.request import urlopen
                                                     File "/var/lib/kodi/.kodi/addons/script.module.future/lib/future/moves/__init__.py", line 5, in <module>
                                                       from future.standard_library import import_top_level_modules
                                                     File "/var/lib/kodi/.kodi/addons/script.module.future/lib/future/standard_library/__init__.py", line 65, in <module>
                                                       import imp
                                                   ModuleNotFoundError: No module named 'imp'
                                                   -->End of Python script error report<--

Screenshots

Here are some links or screenshots to help explain the problem:

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

I reported this to the "backup" addon maintainer (robweber/xbmcbackup#239), however we are not sure where this older version of future comes from. The host OS has python3-future-1.0.0 installed, so it must be bundled/distributed by Kodi somehow?

Your Environment

Used Operating system:

  • Android

  • iOS

  • tvOS

  • Linux

  • macOS

  • Windows

  • Windows UWP

  • Operating system version/name: Alpine Linux 3.20

  • Kodi version: 21.0

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@xbmc-gh-bot xbmc-gh-bot bot added the Triage: Needed (managed by bot!) issue that was just created and needs someone looking at it label May 30, 2024
@neo1973
Copy link
Member

neo1973 commented May 30, 2024

It has already been submitted to the add-on repository, but has not been approved yet: xbmc/repo-scripts#2615

As this isn't an issue in the Kodi code base I'm closing this issue.

@craftyguy
Copy link
Author

@neo1973 ahhh! Thank you for solving the mystery for me! Ya, sounds like this patch should fix it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage: Needed (managed by bot!) issue that was just created and needs someone looking at it
Projects
None yet
Development

No branches or pull requests

2 participants