Handle difficult filenames.

- Involving unix filenames and unicode surrogates...
- Seen in instagram's cinder repo.
This commit is contained in:
Andrew Hamilton 2021-05-06 00:07:40 +10:00
parent 75606d5d20
commit beb98889ca

View file

@ -37,7 +37,7 @@ class Worker:
async def run_tool(self, path, tool): async def run_tool(self, path, tool):
while True: while True:
self.process.stdin.write( self.process.stdin.write(
f"{tool.__qualname__}\n{path}\n".encode("utf-8")) f"{tool.__qualname__}\n{path}\n".encode("utf-8", "surrogatepass"))
data = await self.process.stdout.readline() data = await self.process.stdout.readline()
if data == b"": if data == b"":
await self.create_process() await self.create_process()