Closed laodouya closed 6 months ago
Use https://github.com/minrk/wurlitzer can catch it.
from wurlitzer import pipes
with pipes() as (out, err):
res = chdb.query("select 1", "csv")
errmsg = err.read()
Or use
pipe_out, pipe_in = os.pipe()
os.dup2(pipe_in, 2)
to replace stderr fd temporarily
It seems the wurlitzer
created a new process to do that. I will fix it in chdb C++ after my "rebasing to 23.6" is finished.
Can we close this issue or is it still applicable to 0.11.4?
Still to be fixed
Fixed #105
Describe the unexpected behaviour In version above 0.10, chdb.query() will print error message in stderr. But it can not redirct or catch into variable.
How to reproduce
Expected behavior Error msg catched and stored into err variable