Skip to content

Fix Python 3.13 compatibility (ST 4201)#1989

Merged
kaste merged 1 commit intoSublimeLinter:masterfrom
jfcherng-sublime:fix/py313
Oct 28, 2025
Merged

Fix Python 3.13 compatibility (ST 4201)#1989
kaste merged 1 commit intoSublimeLinter:masterfrom
jfcherng-sublime:fix/py313

Conversation

@jfcherng
Copy link
Copy Markdown
Member

The latest ST 4201, which replaces py38 with py313, has been released as a private beta in the discord. See discord.com/channels/280102180189634562/650695903446827011/1432613579223339059

SublimeLinter has an import error with py313 because some classes have been moved. This fix works both in py38 and py313.

Traceback (most recent call last):
  File "D:\Download\sublime_text_build_4201_x64\Lib\python313\sublime_plugin.py", line 316, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.13/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1051, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "D:\Download\sublime_text_build_4201_x64\Data\Packages\SublimeLinter\sublime_linter.py", line 11, in <module>
    from . import log_handler
  File "D:\Download\sublime_text_build_4201_x64\Data\Packages\SublimeLinter\log_handler.py", line 6, in <module>
    from .lint import util
  File "D:\Download\sublime_text_build_4201_x64\Data\Packages\SublimeLinter\lint\__init__.py", line 6, in <module>
    from . import (
    ...<3 lines>...
    )
  File "D:\Download\sublime_text_build_4201_x64\Data\Packages\SublimeLinter\lint\linter.py", line 3, in <module>
    from collections import ChainMap, Mapping, Sequence
ImportError: cannot import name 'Mapping' from 'collections' (D:\Download\sublime_text_build_4201_x64\Lib\python3.13.zip\collections\__init__.pyc)

There are still some issues need to be fixed in Package Control though.

Traceback (most recent call last):
  File "D:\_Download\sublime_text_build_4201_x64\Lib\python313\sublime_plugin.py", line 551, in on_api_ready
    plc()
    ~~~^^
  File "D:\_Download\sublime_text_build_4201_x64\Data\Packages\SublimeLinter\sublime_linter.py", line 44, in plugin_loaded
    import package_control.events
  File "D:\_Download\sublime_text_build_4201_x64\Data\Lib\python313\package_control.py", line 22, in <module>
    __loader__ = sublime_plugin.ZipLoader(__zip_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'sublime_plugin' has no attribute 'ZipLoader'

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
@kaste kaste merged commit 99a517c into SublimeLinter:master Oct 28, 2025
7 checks passed
@kaste
Copy link
Copy Markdown
Member

kaste commented Oct 28, 2025

Thanks. Yes, importing as/from abc is known to work. Released as 4.28.1 Just for information, I can't currently beta test ST, I need high-throughput, high-velocity right now. 🤞

@jfcherng jfcherng deleted the fix/py313 branch October 28, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants