Working around a strange Python problem 0 ▲ John D. Cook 2 hours ago · Tech · hide · 0 comments A Python script that worked a few days ago wouldn’t work today. I suspect it might have something to do with my updating everything I could think of in response to recent security breaches. I got an error message that said error: The script contains multiple PEP 723 metadata blocks I searched on what that means, then took out the blank line in my header #!/usr/bin/env -S uv run --script # /// script # dependencies = ["pyperclip"] # /// but I still got the same error message. The script in question copies miscellaneous snippets of text to the clipboard for me. One of those snippets is the header block that uv requires. The script contains the header block marker # ///, and that was the source of the problem. According to Grok The PEP 723 parser is purely textual (it uses a regex that scans the whole file). It does not understand Python syntax, so the # /// sequences inside your triple-quoted string are treated as a second metadata block. It suggested changing my quoted string to use #… No comments yet. Log in to reply on the Fediverse. Comments will appear here.