Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipes are not redirected back in 3.1.0 #88

Closed
scturtle opened this issue Jun 12, 2024 · 3 comments · Fixed by #89
Closed

pipes are not redirected back in 3.1.0 #88

scturtle opened this issue Jun 12, 2024 · 3 comments · Fixed by #89

Comments

@scturtle
Copy link

import wurlitzer
with open("log", "w") as f, wurlitzer.pipes(f):
        print("foo")
print("bar")

In 3.0.3, it will print bar. But in 3.1.0 it will print nothing and bar is also in log. Tested on MacOS and Linux.

@scturtle
Copy link
Author

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.

@minrk
Copy link
Owner

minrk commented Jun 12, 2024

Thanks! Tested and fixed by #89

@minrk minrk closed this as completed in #89 Jun 12, 2024
@minrk
Copy link
Owner

minrk commented Jun 12, 2024

released 3.1.1 with the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants