Open leoauri opened 5 months ago
Presumably, libsndfile is writing straight to STDERR. It seems a bit odd that redirect_stderr
doesn't catch that, but perhaps it only operates on the python level?
I tried redirecting the Warning: Xing stream size off by more than 1%
messages using this method, which works for e.g. Blender and TensorFlow C-level logs, but it did not work in this case.
This may be because I am calling sf.read
in subprocesses (with torch's DataLoader)... I will try confining it to the main process.
update: it fails to capture the output in that case, too.
Hi there, in #421 suppressing warnings from underlying libraries is discussed.
In my case I would like to capture the errors, in order to discard mp3s which trigger warnings.
I tried something like:
But the errors go straight to stderr and are not captured by the context manager. Presumably something going on in a subprocess or something.
Any ideas on picking up libmpg123 warnings?