Skip to content

With Python 3.14, pyright checks templatelib.py and complains if --pythonversion < 3.14. #11003

@Torom

Description

@Torom

When I use pyright under Python 3.14 with a Python file that contains any str, pyright checks the file lib/python3.14/string/templatelib.py and complains about the template strings there because --pythonversion is set to a Python version < 3.14.

Test code a.py:

"hello world"

pyright --pythonversion 3.13 a.py leads to:

/home/torsten/.pyenv/versions/3.14.0/lib/python3.14/string/templatelib.py
  /home/torsten/.pyenv/versions/3.14.0/lib/python3.14/string/templatelib.py:3:5 - error: Template string literals (t-strings) require Python 3.14 or newer
  /home/torsten/.pyenv/versions/3.14.0/lib/python3.14/string/templatelib.py:5:24 - error: Cannot access attribute "interpolations" for class "str"
    Attribute "interpolations" is unknown (reportAttributeAccessIssue)
2 errors, 0 warnings, 0 informations

VS Code extension or command-line
cli

pyright --version
pyright 1.1.406

Metadata

Metadata

Assignees

No one assigned

    Labels

    addressed in next versionIssue is fixed and will appear in next published versionbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions