Skip to content

Can not redirct stderr in chdb.query() #54

@laodouya

Description

@laodouya

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

import chdb
from io import StringIO
import sys
from contextlib import redirect_stderr

f = StringIO()
with redirect_stderr(f):
    res = chdb.query("select 1", "csv")
    # sys.stderr.write("write stderr in python")
err = f.getvalue()

print("Capture err by redirect_stderr: ", err)

Expected behavior
Error msg catched and stored into err variable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions