Skip to content

PEP 723 inline metadata tag not found when there's trailing whitespace #10918

@snat-s

Description

@snat-s

Summary

i have an issue with PEP 723, when you have a blank space at the end of the # /// uv doesn't properly parse the closing tag. it tells you that there is an error:

error: An opening tag (`# /// script`) was found without a closing tag (`# ///`). Ensure that every line between the opening and closing tags (including empty lines) starts with a leading `#`.

all the script had was an extra blank space at the end, it can be a bit annoying if this happens.

# /// script
# requires-python = ">=3.11"
# dependencies = [
#   "requests-oauthlib",
#   "requests"
#   "rich",
# ]
# /// 

but not that it is simply that there is an extra blank space at the end.

i'm not sure if it already solved but just letting you know!

Platform

Linux 6.12.9-200.fc41.x86_64 x86_64 GNU/Linux

Version

uv 0.5.1

Python version

Python 3.11.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    error messagesMessaging when something goes wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions