Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tts-ranking
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
audio
tts-ranking
Commits
07cae1b7
Commit
07cae1b7
authored
Jul 13, 2026
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(luna-tts): protect send_message from BrokenPipeError
parent
72982948
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
server/native_host.py
+3
-0
No files found.
server/native_host.py
View file @
07cae1b7
...
@@ -56,10 +56,13 @@ def read_message():
...
@@ -56,10 +56,13 @@ def read_message():
def
send_message
(
msg
):
def
send_message
(
msg
):
"""Send a native messaging message to stdout."""
"""Send a native messaging message to stdout."""
try
:
encoded
=
json
.
dumps
(
msg
,
ensure_ascii
=
False
)
.
encode
(
'utf-8'
)
encoded
=
json
.
dumps
(
msg
,
ensure_ascii
=
False
)
.
encode
(
'utf-8'
)
sys
.
stdout
.
buffer
.
write
(
struct
.
pack
(
'=I'
,
len
(
encoded
)))
sys
.
stdout
.
buffer
.
write
(
struct
.
pack
(
'=I'
,
len
(
encoded
)))
sys
.
stdout
.
buffer
.
write
(
encoded
)
sys
.
stdout
.
buffer
.
write
(
encoded
)
sys
.
stdout
.
buffer
.
flush
()
sys
.
stdout
.
buffer
.
flush
()
except
(
BrokenPipeError
,
OSError
):
pass
def
download_audio
(
url
:
str
,
dest
:
Path
)
->
bool
:
def
download_audio
(
url
:
str
,
dest
:
Path
)
->
bool
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment