Skip to content

engine.eval without assigned stdout does not handle Unicode correctly #34

Closed
@allefeld

Description

@allefeld

Example: The Unicode character '→' (U+2192) appears in the output as U+001A.

image

That does not happen if the stdout argument is assigned to a StringIO instance.

image

However, the disadvantage is that output assigned to stdout is heavily buffered. If I have a long-running computation which continuously produces output, I have to choose between proper Unicode output and immediate feedback.

I though this might be a property of StringIO, and tried to intercept write calls.

image

But from the result it is clear that stdout.write is only called once. I also tried to induce flushing by inserting newline characters in the output, with no success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions