[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Interpreting the last post ... -- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-23 Thread San
San added the comment: I just realised that this is not a problem of python but rather a problem of the shell that I was using. I was testing the io in a different environment. Now I retried in the same environment that the wrapper was operating and the behaviour is the same using io. Sorry

[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-23 Thread San
San added the comment: I get your point. But I thought setting 'stdout=PIPE' should not send the stdout directly to the terminal but rather through the pipe first?! Also what you're saying seems to contradict that this doesn't happen if I don't set the encoding and let it be a byte-stream. I

[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: I might be missing something here, but if you send arbitrary binary data to stdout, where it gets written to the terminal, strange things are likely to happen. The terminal interprets the shell characters before Python gets to see them. I think that this i

[issue44709] [3.7] Popen Control Characters in stdout affect shell session

2021-07-22 Thread San
New submission from San : I was trying to wrap an old game server executable with a built-in console using Popen. class ServerWrapper(Thread): def __init__(self, pathToExecutable: str, statusMonitor: Popen = None, active: bool = False): super().__init__() self.pathToExecut