Skip to content

examples: use env -S so example shebangs work on Linux#3262

Closed
LeSingh1 wants to merge 1 commit into
openai:mainfrom
LeSingh1:fix-examples-shebang-env-S
Closed

examples: use env -S so example shebangs work on Linux#3262
LeSingh1 wants to merge 1 commit into
openai:mainfrom
LeSingh1:fix-examples-shebang-env-S

Conversation

@LeSingh1
Copy link
Copy Markdown

Summary

Three example scripts have a shebang of:

#!/usr/bin/env rye run python

This works on macOS BSD env, but on Linux /usr/bin/env does not split the interpreter spec on spaces and instead tries to exec a binary literally named "rye run python", which fails with bad interpreter: no such file or directory. The fix is to add the -S flag, which tells env to tokenize the rest of the line.

CONTRIBUTING.md already documents the correct form:

#!/usr/bin/env -S rye run python

and the rest of examples/ (async_demo.py, demo.py, streaming.py, video.py) already uses -S with the poetry/python runner. This PR brings the three remaining files in line.

Files touched

  • examples/audio.py
  • examples/speech_to_text.py
  • examples/text_to_speech.py

Verification

Manual test on Linux confirms the previous form fails and the -S form executes the script. No SDK behavior change.

The shebangs in audio.py, speech_to_text.py, and text_to_speech.py
omitted -S, which makes /usr/bin/env on Linux treat the entire
remaining string ("rye run python") as a single argv token and
fail with 'no such file or directory'.

CONTRIBUTING.md already documents the correct form
`#!/usr/bin/env -S rye run python`, and the rest of examples/
(async_demo.py, demo.py, streaming.py, video.py) uses the -S
flag with poetry/python. Bring these three in line.
@LeSingh1 LeSingh1 requested a review from a team as a code owner May 18, 2026 06:55
@LeSingh1
Copy link
Copy Markdown
Author

Closing — I missed that #3210 already proposes the exact same fix (and is more complete, since it also covers examples/realtime/realtime.py). Sorry for the noise; please merge #3210.

@LeSingh1 LeSingh1 closed this May 18, 2026
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