[issue8048] doctest assumes sys.displayhook hasn't been touched

2010-03-04 Thread Noam Yorav-Raphael
Noam Yorav-Raphael added the comment: Ok, here's a patch (against current svn of Python 2) with a test case. I had to fix three tests which combined pdb and doctest, since now, when run under doctest, pdb steps into the displayhook because it's a Python function and not a built-i

[issue8048] doctest assumes sys.displayhook hasn't been touched

2010-03-19 Thread Noam Yorav-Raphael
Noam Yorav-Raphael added the comment: Here is a better and much shorter patch: I use sys.__displayhook__ instead of implementing it in Python, which has the nice side effect of not changing pdb behaviour. -- Added file: http://bugs.python.org/file16581/patch

[issue8213] Python 3 ignored PYTHONUNBUFFERED and -u

2010-03-23 Thread Noam Yorav-Raphael
New submission from Noam Yorav-Raphael : Hello, Python 3.1 ignored the PYTHONUNBUFFERED environment variable and the '-u' switch (which do the same thing): stdout remains buffered even when the flag is raised. To reproduce, run: > python3 -u -c 'import time, sys; s

[issue8213] Python 3 ignored PYTHONUNBUFFERED and -u

2010-03-23 Thread Noam Yorav-Raphael
Noam Yorav-Raphael added the comment: I typed "man python3" on ubuntu 9.10 and nothing was explained about that - I now checked and found out that it displayed the python2 man page. I don't know where to find the Python 3 man page. I don't quite see the point in having

[issue8213] Python 3 ignored PYTHONUNBUFFERED and -u

2010-03-24 Thread Noam Yorav-Raphael
Noam Yorav-Raphael added the comment: I can call flush() after the user code was executed, but a code like this: >>> for i in range(10): ... print(i, end=' ') ... time.sleep(1) will show the numbers only after 10 seconds, while I would like a number printed ever

[issue26092] doctest should allow custom sys.displayhook

2021-04-26 Thread Noam Yorav-Raphael
Noam Yorav-Raphael added the comment: Hi, I think that using mock.patch to fix the problem is fine. I personally haven't encountered this problem in the past years, so whatever you decide is fine by me. Thanks! Noam On Mon, Apr 26, 2021 at 10:08 AM Sergey B Kirpichev wrote: > &g

[issue26092] doctest should allow custom sys.displayhook

2021-04-26 Thread Noam Yorav-Raphael
Noam Yorav-Raphael added the comment: Yes, sorry, I didn't remember the history exactly. I don't have a strong opinion. I'm okay with reverting the behavior to use sys.displayhook. Thanks, Noam -- ___ Python tracker <https

[issue26092] doctest should allow custom sys.displayhook

2019-05-16 Thread Noam Yorav-Raphael
Noam Yorav-Raphael added the comment: Tim, thanks for letting me know. I certainly don't mind if you close this bug, since it undoes my old (and still relevant) fix. -- nosy: +noamraph ___ Python tracker <https://bugs.python.org/is

[issue35330] When using mock to wrap an existing object, side_effect requires return_value

2018-11-27 Thread Noam Yorav-Raphael
New submission from Noam Yorav-Raphael : When using mock to wrap an existing object, and using side_effect to set a function to wrap a method, I would expect the wrapper function to be called instead of the wrapped function, and its return value to be returned. Instead, both the wrapper