It looks like you're new here. If you want to get involved, click one of these buttons!
My script converts a GDS file into a proprietary format. The output file must go to stdout. However, layout.read() sometimes writes warnings to stdout (e.g. "Warning: Record length larger than 0x8000 encountered"), thus breaking the output file format. I need to redirect these warnings to stderr, but all my attempts with context_manager.redirect_stdout() failed. The only way to redirect seems to do this from the command-line (with > operator), but in this case, the output file is also redirected away from stdout, which is not what I want.
Can you think of a way to force klayout module functions to use stderr instead of stdout?