Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Add support for Python 3 #34

Closed
edmorley opened this issue May 30, 2017 · 1 comment · Fixed by #48
Closed

Add support for Python 3 #34

edmorley opened this issue May 30, 2017 · 1 comment · Fixed by #48

Comments

@edmorley
Copy link
Contributor

Currently bob --help fails with:

Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.4.6/bin/bob", line 7, in <module>
    from bob import cli
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/bob/__init__.py", line 1, in <module>
    from . import cli
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/bob/cli.py", line 20, in <module>
    from .models import Formula
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/bob/models.py", line 33, in <module>
    sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
  File "/home/travis/virtualenv/python3.4.6/lib/python3.4/os.py", line 982, in fdopen
    return io.open(fd, *args, **kwargs)
ValueError: can't have unbuffered text I/O

See:
https://travis-ci.org/kennethreitz/bob-builder/jobs/237710697#L239

@dzuelke
Copy link
Contributor

dzuelke commented Mar 23, 2019

Unfortunately, this doesn't work:

sys.stdout = os.fdopen(sys.stdout.fileno(), 'wb', 0)
sys.stderr = os.fdopen(sys.stderr.fileno(), 'wb', 0)

The result is no more output at all in Python3...

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

Successfully merging a pull request may close this issue.

3 participants