New submission from Noam Raphael <noamr...@gmail.com>:

Hello,

This bug is the cause of a bug reported about DreamPie: 
https://bugs.launchpad.net/bugs/530969

DreamPie (http://dreampie.sourceforge.net) changes sys.displayhook so that 
values will be sent to the parent process instead of being printed in stdout. 
This causes doctest to fail when run from DreamPie, because it implicitly 
assumes that sys.displayhook writes the values it gets to sys.stdout. This is 
why doctest replaces sys.stdout with its own file-like object, which is ready 
to receive the printed values.

The solution is simply to replace sys.displayhook with a function that will do 
the expected thing, just like sys.stdout is replaced. The patch I attach does 
exactly this.

Thanks,
Noam

----------
components: Library (Lib)
files: doctest.py.diff
keywords: patch
messages: 100334
nosy: noam
severity: normal
status: open
title: doctest assumes sys.displayhook hasn't been touched
type: behavior
Added file: http://bugs.python.org/file16421/doctest.py.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8048>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to