examples: use env -S so example shebangs work on Linux#3262
Closed
LeSingh1 wants to merge 1 commit into
Closed
Conversation
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.
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three example scripts have a shebang of:
This works on macOS BSD
env, but on Linux/usr/bin/envdoes not split the interpreter spec on spaces and instead tries to exec a binary literally named"rye run python", which fails withbad interpreter: no such file or directory. The fix is to add the-Sflag, which tellsenvto tokenize the rest of the line.CONTRIBUTING.mdalready documents the correct form:and the rest of
examples/(async_demo.py,demo.py,streaming.py,video.py) already uses-Swith thepoetry/pythonrunner. This PR brings the three remaining files in line.Files touched
examples/audio.pyexamples/speech_to_text.pyexamples/text_to_speech.pyVerification
Manual test on Linux confirms the previous form fails and the
-Sform executes the script. No SDK behavior change.