mkorpela / overrides

A decorator to automatically detect mismatch when overriding a method
Apache License 2.0
262 stars 32 forks source link

Crashes on its imporing `typing.BytesString` with Python 3.14.0a2 #127

Open kLiHz opened 1 week ago

kLiHz commented 1 week ago

I recently ran Jupyter Lab on Python 3.14.0a2 and got errors like this (see log below). I checked Python 3.14's documentation and it says typing.ByteString is removed. Although Jupyter Lab doesn't seems to be using it, Python 3.14 crashes on .py imports that uses typing.ByteString (I commented out that line and Jupyter Lab seems to be working). Anyway, it's said to be deprecated since Python 3.9.

I'd like to do something but I don't think I'm familiar with these 😥, so I'm more like just reporting this. I hope it may help!

By the way, I'm not sure if there's other deprecations, but from overrides import overrides can be executed without errors after commenting out Line 50 of typing_utlis.py.

See Python Traceback ``` Traceback (most recent call last): File "/home/user/python-3.14.0a2/bin/jupyter-lab", line 5, in from jupyterlab.labapp import main File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/jupyterlab/__init__.py", line 8, in from .handlers.announcements import ( ...<3 lines>... ) File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/jupyterlab/handlers/announcements.py", line 15, in from jupyterlab_server.translation_utils import translator File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/jupyterlab_server/__init__.py", line 6, in from .app import LabServerApp File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/jupyterlab_server/app.py", line 10, in from jupyter_server.extension.application import ExtensionApp, ExtensionAppJinjaMixin File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/jupyter_server/extension/application.py", line 17, in from jupyter_server.serverapp import ServerApp File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/jupyter_server/serverapp.py", line 107, in from jupyter_server.gateway.managers import ( ...<3 lines>... ) File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/jupyter_server/gateway/managers.py", line 27, in from ..services.kernels.kernelmanager import ( ...<3 lines>... ) File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 27, in from overrides import overrides File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/overrides/__init__.py", line 8, in from overrides.overrides import __VERSION__, overrides, override File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/overrides/overrides.py", line 26, in from overrides.signature import ensure_signature_is_compatible File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/overrides/signature.py", line 6, in from .typing_utils import get_args, issubtype File "/home/user/python-3.14.0a2/lib/python3.14/site-packages/overrides/typing_utils.py", line 50, in typing.ByteString: bytes, # https://docs.python.org/3/library/typing.html#typing.ByteString ^^^^^^^^^^^^^^^^^ File "/home/user/python-3.14.0a2/lib/python3.14/typing.py", line 3831, in __getattr__ raise AttributeError(f"module {__name__!r} has no attribute {attr!r}") AttributeError: module 'typing' has no attribute 'ByteString' ```
mkorpela commented 2 days ago

Thanks @kLiHz ! Have to tackle this before the release https://peps.python.org/pep-0745/