Skip to content

Instantly share code, notes, and snippets.

@mgedmin
Last active January 4, 2016 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgedmin/8559853 to your computer and use it in GitHub Desktop.
Save mgedmin/8559853 to your computer and use it in GitHub Desktop.
curses.setupterm() in a doctest
mg@platonas: ~/src/new-zope-order/zope.testrunner [git:master $=] $ cat doctest.txt
>>> import curses
>>> curses.setupterm()
mg@platonas: ~/src/new-zope-order/zope.testrunner [git:master $=] $ python -m doctest doctest.txt
**********************************************************************
File "doctest.txt", line 2, in doctest.txt
Failed example:
curses.setupterm()
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python2.7/doctest.py", line 1289, in __run
compileflags, 1) in test.globs
File "<doctest doctest.txt[1]>", line 1, in <module>
curses.setupterm()
TypeError: argument must be an int, or have a fileno() method.
**********************************************************************
1 items had failures:
1 of 2 in doctest.txt
***Test Failed*** 1 failures.
[exited with 1]
mg@platonas: ~/src/new-zope-order/zope.testrunner [git:master $=] $ pypy -m doctest doctest.txt
**********************************************************************
File "doctest.txt", line 2, in doctest.txt
Failed example:
curses.setupterm()
Exception raised:
Traceback (most recent call last):
File "/usr/lib/pypy/lib-python/2.7/doctest.py", line 1289, in __run
compileflags, 1) in test.globs
File "<doctest doctest.txt[1]>", line 1, in <module>
curses.setupterm()
File "/usr/lib/pypy/lib_pypy/_curses.py", line 1102, in setupterm
fd = sys.stdout.fileno()
AttributeError: _SpoofOut instance has no attribute 'fileno'
**********************************************************************
1 items had failures:
1 of 2 in doctest.txt
***Test Failed*** 1 failures.
[exited with 1]
mg@platonas: ~/src/new-zope-order/zope.testrunner [git:master $=] $ python3 -m doctest doctest.txt
**********************************************************************
File "doctest.txt", line 2, in doctest.txt
Failed example:
curses.setupterm()
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest doctest.txt[1]>", line 1, in <module>
curses.setupterm()
io.UnsupportedOperation: fileno
**********************************************************************
1 items had failures:
1 of 2 in doctest.txt
***Test Failed*** 1 failures.
[exited with 1]
@mgedmin
Copy link
Author

mgedmin commented Jan 22, 2014

python is 2.7.5+
python3 is 3.3.2+
pypy is 2.0.2

the OS is Ubuntu 13.10

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