Skip to content

fix(examples): split push-to-talk shebang arguments - #3210

Merged
marcuswood-oai merged 3 commits into
openai:mainfrom
lucky-verma:chore/examples-shebang-portable
Sep 15, 2026
Merged

marcuswood-oai merged 3 commits into
openai:mainfrom
lucky-verma:chore/examples-shebang-portable

Conversation

@lucky-verma

@lucky-verma lucky-verma commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

five executable examples use an env shebang without -S:

examples/audio.py
examples/speech_to_text.py
examples/text_to_speech.py
examples/realtime/realtime.py
examples/realtime/push_to_talk_app.py

added push_to_talk_app.py per your review. i checked every mode-100755 file under examples/ and those five are the only ones missing -S. (azure.py, azure_ad.py and module_client.py are 755 with no shebang at all — different issue, left alone.)

also correcting myself: i said linux env splits the args so this only broke on older BSD. that's wrong, it fails there too — on coreutils 9.4 ./examples/audio.py gives env: 'rye run python': No such file or directory.

only shebang lines change. modes unchanged, ruff check + format clean on all five.

@DTiming24

Copy link
Copy Markdown

Good portability cleanup. env -S is a subtle but important change here; a brief note in the examples README about the minimum shell/coreutils support would help users on older environments avoid surprises.

@stainless-app
stainless-app Bot force-pushed the next branch 2 times, most recently from 317260c to e67afa8 Compare July 22, 2026 17:46

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One same-class executable shebang is still missing from this portability sweep: examples/realtime/push_to_talk_app.py:1 remains #!/usr/bin/env uv run (mode 100755). On Linux, the kernel passes uv run as one argument and GNU env tries to find an executable with that literal name, so direct invocation fails with the same error these four edits fix. Please change it to #!/usr/bin/env -S uv run as well. The four modified Rye shebangs, executable modes, Ruff/format checks, and compile validation are otherwise clean.

Five executable examples use an env shebang without the -S flag:
  examples/audio.py
  examples/speech_to_text.py
  examples/text_to_speech.py
  examples/realtime/realtime.py
  examples/realtime/push_to_talk_app.py

CONTRIBUTING.md shows the canonical form as #!/usr/bin/env -S rye run python.
Without -S the kernel passes the whole interpreter string to env as one
argument, so env looks for a program named 'rye run python' and the script
fails. This affects GNU env as well as BSD env. The first four use the rye
shebang; push_to_talk_app.py has the same defect with 'uv run'.

Only shebang lines change; executable modes are unchanged.
@lucky-verma
lucky-verma force-pushed the chore/examples-shebang-portable branch from dd7db2c to ae028fc Compare August 4, 2026 06:14
@lucky-verma

Copy link
Copy Markdown
Contributor Author

added -S to push_to_talk_app.py. also corrected the linux claim in the description — you were right, it fails there too. PTAL

@marcuswood-oai marcuswood-oai changed the title chore(examples): add -S to env shebangs for portability fix(examples): split push-to-talk shebang arguments Sep 15, 2026
@marcuswood-oai
marcuswood-oai changed the base branch from next to main September 15, 2026 17:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-15T18:00:51.106449Z 7b74cd8 New commits
🔒 Security Review ✅ Completed 2026-09-15T18:02:32.315780Z 7b74cd8 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

43 mixed files remain; 0 existing customizations changed.

Compared 1493321affb1 → 7b74cd88caa0. Generated baselines verified.

43 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/openai/init.py
  • src/openai/_client.py
  • src/openai/resources/audio/transcriptions.py
  • src/openai/resources/audio/translations.py
  • src/openai/resources/beta/agents/sessions/sessions.py
  • src/openai/resources/beta/beta.py
  • src/openai/resources/beta/responses/responses.py
  • src/openai/resources/beta/threads/runs/runs.py
  • src/openai/resources/beta/threads/threads.py
  • src/openai/resources/chat/completions/completions.py
  • src/openai/resources/embeddings.py
  • src/openai/resources/files.py
  • src/openai/resources/live/forks.py
  • src/openai/resources/live/live.py
  • src/openai/resources/live/sideband.py
  • src/openai/resources/realtime/realtime.py
  • src/openai/resources/responses/responses.py
  • src/openai/resources/uploads/uploads.py
  • src/openai/resources/vector_stores/file_batches.py
  • src/openai/resources/vector_stores/files.py
  • src/openai/resources/videos.py
  • src/openai/resources/webhooks/init.py
  • src/openai/resources/webhooks/webhooks.py
  • src/openai/types/beta/agent_session_message.py
  • src/openai/types/chat/init.py
  • src/openai/types/chat/chat_completion_message_tool_call.py
  • src/openai/types/fine_tuning/fine_tuning_job_integration.py
  • src/openai/types/responses/init.py
  • src/openai/types/responses/response.py
  • src/openai/types/responses/response_function_web_search.py
  • src/openai/types/responses/response_function_web_search_param.py
  • src/openai/types/responses/responses_client_event.py
  • src/openai/types/responses/responses_client_event_param.py
  • src/openai/types/responses/tool.py
  • src/openai/types/responses/tool_param.py
  • src/openai/types/webhooks/init.py

3 more in the full report.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 35005432454 --repo openai/openai-python \
  --name castiron-custom-code-35005432454-1 --dir /tmp/castiron-custom-code-35005432454-1
git apply --stat /tmp/castiron-custom-code-35005432454-1/custom-code.patch
cat /tmp/castiron-custom-code-35005432454-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 1493321affb1814fba7b669892e376a119d8d36f 7b74cd88caa0219b3ccc82cf011521d4d034931a
python3 scripts/castiron/custom_code_report.py report \
  --base 1493321affb1814fba7b669892e376a119d8d36f \
  --head 7b74cd88caa0219b3ccc82cf011521d4d034931a --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-7b74cd88caa0
cat /tmp/castiron-custom-code-7b74cd88caa0/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

Copy link
Copy Markdown
Contributor

Thanks for fixing this. The push-to-talk example still passes uv run as a single executable name when launched directly. Adding -S fixes the argument splitting and matches uv’s documented shebang usage.

@marcuswood-oai
marcuswood-oai dismissed jbeckwith-oai’s stale review September 15, 2026 18:09

Thanks for fixing this. The push-to-talk example still passes uv run as a single executable name when launched directly. Adding -S fixes the argument splitting and matches uv’s documented shebang usage.

@marcuswood-oai
marcuswood-oai added this pull request to the merge queue Sep 15, 2026
Merged via the queue into openai:main with commit d241ed6 Sep 15, 2026
16 checks passed
@openai-sdks openai-sdks Bot mentioned this pull request Sep 15, 2026
pull Bot pushed a commit to Pyrex77/openai-python that referenced this pull request Sep 15, 2026
Automated Release PR
---


##
[3.14.1](openai/openai-python@v3.14.0...v3.14.1)
(2026-09-15)


### Bug Fixes

* **client:** validate retry limits and preserve application errors
([openai#3867](openai#3867))
([f86c721](openai@f86c721))
* correct typo "th" to "the" in StreamAlreadyConsumed error message
([openai#3022](openai#3022))
([7186203](openai@7186203))
* **examples:** correct Azure endpoint hostname
([openai#3298](openai#3298))
([543516c](openai@543516c))
* **examples:** refresh chat streaming examples
([openai#2974](openai#2974))
([54f460e](openai@54f460e))
* **examples:** split push-to-talk shebang arguments
([openai#3210](openai#3210))
([d241ed6](openai@d241ed6))
* **examples:** use uv in remaining Python launchers
([openai#3821](openai#3821))
([8c76c4f](openai@8c76c4f))
* log only metadata for Live WebSocket diagnostics
([openai#3865](openai#3865))
([ccc10f5](openai@ccc10f5))
* **responses:** skip structured parsing for commentary
([openai#3861](openai#3861))
([6520df1](openai@6520df1))


### Chores

* **examples:** bump module_client.py to gpt-5.6
([openai#3211](openai#3211))
([1493321](openai@1493321))
* remove unused fine-tuning data validators
([openai#3863](openai#3863))
([9640f29](openai@9640f29))


### Documentation

* clarify async client cleanup
([openai#2388](openai#2388))
([a3d83b5](openai@a3d83b5))
* clarify filenames for in-memory file uploads
([openai#3729](openai#3729))
([cb27380](openai@cb27380))
* **client:** correct retry jitter comment
([openai#2252](openai#2252))
([bdbbc16](openai@bdbbc16))
* fix Realtime docstring wording
([openai#3535](openai#3535))
([8cb9ded](openai@8cb9ded))
* fix reusing wording in Azure client docstrings
([openai#3061](openai#3061))
([dc625f9](openai@dc625f9))
* fix streaming comment typo
([openai#3005](openai#3005))
([d421d7a](openai@d421d7a))
* fix vector store polling helper paths
([openai#3101](openai#3101))
([2ef2de6](openai@2ef2de6))
* **readme:** correct SSE terminology
([openai#2837](openai#2837))
([caaa9b4](openai@caaa9b4))
* update Responses API reference link
([openai#3279](openai#3279))
([557bd06](openai@557bd06))
* **utils:** correct query component RFC reference
([openai#3300](openai#3300))
([929a8a5](openai@929a8a5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
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.

4 participants