-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix message corruption in picotts component #141182
base: dev
Are you sure you want to change the base?
Conversation
… the newer subprocess.run method and checking the pico2wave return code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
I was unable to run the full test suite due a lot of "No module named" errors during tests collection, using the DevContainer environment, regardless installation of all dev and test requirements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
homeassistant/components/picotts/tts.py:63
- [nitpick] Consider capturing stderr (e.g., by setting capture_output=True in subprocess.run) and logging it along with the return code to provide clearer diagnostics when pico2wave fails.
if result.returncode != 0:
data = None | ||
try: | ||
if result.returncode != 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the error branch, the temporary file is not removed, which could lead to resource leaks. Consider adding cleanup logic (e.g., os.remove(fname)) after logging the error.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Breaking change
Proposed change
This fixes #93456, by sending the message to pico2wave subprocess using the stdin instead of command line arguments, as command line arguments seem to cause issues without a clear root cause.
Usage of stdin should be security equivalent, if not more secure, to usage of command line argument in shell-less subprocesses.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: