[issue10144] Buffering bug after calling curses function

Wes McKinney report at bugs.python.org
Tue Oct 19 06:05:48 CEST 2010


New submission from Wes McKinney <wesmckinn at gmail.com>:

We tracked a bug originating in IPython to the Python interpreter itself, seems to be present in 2.6.x and 2.7.x but not 3.1.x. This is on Ubuntu Linux 10.04, does not seem to occur in OS X 10.6.

Reference: http://article.gmane.org/gmane.comp.python.ipython.user/5336

> cat bufferbug.py
"""Strange bug in buffering of sys.stdout after calling curses functions.
"""
import time
import curses

def bug():
   curses.initscr()
   curses.endwin()

def f(n=2):
   s = 0.75
   for i in range(n):
       print i
       time.sleep(s)
   print i+1

if __name__ == '__main__':
   f()
   print 'Calling bug() now!'
   bug()
   f()

####

----------
components: Interpreter Core
messages: 119115
nosy: Wes.McKinney
priority: normal
severity: normal
status: open
title: Buffering bug after calling curses function
type: behavior
versions: Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10144>
_______________________________________


More information about the Python-bugs-list mailing list