Skip to content

docs: explain how to avoid inline metadata false positives - #14

Open
harshitethic wants to merge 1 commit into
mainfrom
docs/1835-escape-inline-script-metadata
Open

harshitethic wants to merge 1 commit into
mainfrom
docs/1835-escape-inline-script-metadata

Conversation

@harshitethic

@harshitethic harshitethic commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Addresses pypa#1835.

PEP 723 intentionally allows tools to scan source text instead of parsing Python. That means a metadata-looking block embedded verbatim in a multi-line string can be mistaken for actual inline script metadata.

This adds a recommendation that:

  • explains the false-positive condition at the source-text level;
  • tells authors to avoid complete metadata openers at the beginning of physical source lines when the text is only data;
  • shows a compile-time adjacent-string-literal technique that preserves the runtime string without exposing a top-level-looking marker to textual scanners.

The normative parsing rules are unchanged; this is usage guidance only.


📚 Documentation preview 📚: https://python-packaging-user-guide--14.org.readthedocs.build/en/14/

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

Successfully merging this pull request may close these issues.

1 participant