Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2025 08:22 AM
@ToBeDataDriven ,
redirect_stdout is process-global, not per-thread.
It temporarily rebinds sys.stdout for the whole interpreter, so in a thread pool, you can accidentally swallow other threads’ prints while the with block is active. It’s not thread-safe for your use case. If you need all the output except fs.put, then you need to isolate it; otherwise, I dont think there is another option.
Anudeep