New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing after reassigning sys.stdout fails on Python 3 #30

takluyver opened this Issue Dec 13, 2013 · 0 comments


None yet
1 participant

takluyver commented Dec 13, 2013

With an error like this:

  File "/usr/lib/python3/dist-packages/pexpect/", line 276, in <module>
    class spawn(object):
  File "/usr/lib/python3/dist-packages/pexpect/", line 286, in spawn
    write_to_stdout = sys.stdout.buffer.write
AttributeError: '_io.StringIO' object has no attribute 'buffer'

The aim was to have a standard way to write bytes to stdout, but if stdout is reassigned to a StringIO, which expects unicode, it's not clear what we should do about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment