Closed scturtle closed 5 months ago
import os
import wurlitzer
cpid = os.fork()
if cpid == 0:
with open("log", "w") as f, wurlitzer.pipes(f):
print("foo")
else:
os.waitpid(cpid, 0)
print("bar")
For this code, 3.1.0 seems to be right. But 3.0.3 puts nothing in log
file.
Thanks! Tested and fixed by #89
released 3.1.1 with the fix
In 3.0.3, it will print
bar
. But in 3.1.0 it will print nothing andbar
is also inlog
. Tested on MacOS and Linux.