You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
process.run raises UnicodeEncodeError for an input string with a lone surrogate #760
run in dokimi/dokimi/process.py:190 encodes a string input with input.encode("utf-8") before it spawns the child (lines 746 and 777 do the same in the other entry points). A prompt built from a question or an artifact text with a \ud800 JSON escape reaches it. Repro: process.run(['cat'], input=json.loads('"n\\ud800"'), timeout=5, env=process.Env.inherit()) raises UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position N: surrogates not allowed at process.py:190. It is not a hash, so the fix is a decision: refuse the input with a message where the prompt is built, or encode with errors='replace' for the child's stdin (a lone surrogate has no UTF-8 form, so surrogatepass would send invalid UTF-8 to the child). Only line 190 was run; 746 and 777 were read.
Activity