[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-10 Thread Martin Panter
Martin Panter added the comment: My second attempt seems to have avoided the hang. For the record, the backtrace from 3.4.koobs-freebsd9 did say it was hanging at the os.waitpid() line, but I still don’t understand why. -- status: open -> closed

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 425d81d10b13 by Martin Panter in branch '3.4': Issue #24402: Fix input() when stdout.fileno() fails; diagnosed by Eryksun https://hg.python.org/cpython/rev/425d81d10b13 New changeset e97d940a6543 by Martin Panter in branch '3.5': Issue #24402:

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Martin Panter
Martin Panter added the comment: Okay I plan to commit a modified version where I moved the input() test methods that use pseudo terminals to a new PtyTests class. The test_input() method stays in the original class, because it shares a helper method with other tests. I am resisting dropping

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Martin Panter
Martin Panter added the comment: Seems my test hangs the Free BSD 9 buildbot, although Free BSD 10 apparently passed. http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.4/builds/1128/steps/test/logs/stdio [390/390] test_builtin Timeout (1:00:00)! Thread 0x000801407400 (most

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Martin Panter
Martin Panter added the comment: I wrote this on Arch Linux, so I doubt your Ubuntu failure is valid. The error you see is what I would expect if the bug were not actually fixed. I suspect you need to recompile /Python/bltinmodule.c, which contains the bug fix. However, the test also hangs OS

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Xiang Zhang
Xiang Zhang added the comment: It's my fault. I forget to recompile. Now it works. -- ___ Python tracker ___

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Xiang Zhang
Xiang Zhang added the comment: This test also fails on Ubuntu. [1/1] test_builtin test test_builtin failed -- Traceback (most recent call last): File "/home/angwer/my-cpython/Lib/test/test_builtin.py", line 1588, in test_input_no_stdout_fileno self.assertEqual(status, 0, output)

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset d8dd9015b086 by Martin Panter in branch '3.4': Issue #24402: Factor out PtyTests.run_child() in input() tests https://hg.python.org/cpython/rev/d8dd9015b086 New changeset 6a8f96b46dce by Martin Panter in branch '3.5': Issue #24402: Merge potential

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> martin.panter stage: patch review -> commit review ___ Python tracker ___

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. See also minor note on Rietveld. I think it is worth to extract all input() tests to separate class. -- nosy: +serhiy.storchaka ___ Python tracker

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-07 Thread Martin Panter
Martin Panter added the comment: This patch includes a test case using pty.fork() to ensure stdin is a terminal, so the bug would be triggered. It is a bit tricky, but hopefully works on Unix platforms. I have only tested it on Linux. -- Added file:

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-06 Thread Martin Panter
Martin Panter added the comment: Patch itself looks good. -- nosy: +martin.panter stage: needs patch -> patch review ___ Python tracker ___

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-06-12 Thread Tal Einat
Tal Einat added the comment: Okay, so the change is straightforward. With this change the entire test suite passes on my machine. We'll need a test for this for the test suite, and that's far less straightforward. It seems that test.test_builtin.BuiltinTest.check_input_tty() could be a

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-06-12 Thread Tal Einat
Tal Einat added the comment: Here's a patch with just the required fix (no tests). -- keywords: +patch Added file: http://bugs.python.org/file39697/issue24402.fix_only.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24402

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-06-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- stage: - needs patch versions: +Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24402 ___

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-06-07 Thread eryksun
eryksun added the comment: This looks like an oversight. In the implementation in [bltinmodule.c][1], if checking sys.stdout.fileno() fails, it clears the error without setting tty = 0. It's the [same in 3.5][2]. /* We should only use (GNU) readline if Python's sys.stdin and

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-06-07 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24402 ___ ___ Python-bugs-list mailing list

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-06-07 Thread Keita Kita
New submission from Keita Kita: On Python 3.4, input() does not use wrapped sys.stdout. For example, the following script should print Wrapped stdout by print() and input() because sys.stdout is replaced with Writer object. import io import sys class Writer: def