Skip to content

functions-framework-python does not work with python 3.13+ #350

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

Closed
mrbuk opened this issue Oct 31, 2024 · 1 comment
Closed

functions-framework-python does not work with python 3.13+ #350

mrbuk opened this issue Oct 31, 2024 · 1 comment
Assignees

Comments

@mrbuk
Copy link

mrbuk commented Oct 31, 2024

Running functions-framework-python with Python 3.13 leads to the following error:

% functions-framework-python --target check_http
Traceback (most recent call last):
  File "/Users/mbukowski/workspace/chronicle-export-data/.venv/bin/functions-framework-python", line 5, in <module>
    from functions_framework._cli import _cli
  File "/Users/mbukowski/workspace/chronicle-export-data/.venv/lib/python3.13/site-packages/functions_framework/__init__.py", line 37, in <module>
    from functions_framework import (
    ...<4 lines>...
    )
  File "/Users/mbukowski/workspace/chronicle-export-data/.venv/lib/python3.13/site-packages/functions_framework/_function_registry.py", line 19, in <module>
    from re import T
ImportError: cannot import name 'T' from 're' (/opt/homebrew/Cellar/[email protected]/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/re/__init__.py)

Trying to run from re import T directly in Python 3.13 leads to the same error

Python 3.13.0 (main, Oct 19 2024, 02:19:02) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from re import T
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    from re import T
ImportError: cannot import name 'T' from 're' (/usr/local/lib/python3.13/re/__init__.py)

in comparison for 3.12 it works

Python 3.12.7 (main, Oct 19 2024, 03:00:35) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from re import T
>>>

Assumption is that this is due to the deprecation of typing.re in Python 3.13 as described in the GH Issue Deprecate the typing.io and typing.re pseudo-modules #82472

@nifflets
Copy link
Contributor

Thanks for bringing this to our attention! This was also noticed by @glasnt in #349 which has now been merged. It should be fixed now in v3.8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants