[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Changes by STINNER Victor victor.stin...@haypocalc.com: -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
STINNER Victor victor.stin...@haypocalc.com added the comment: Ooops, I specified the wrong issue number in my commits :-/ New changeset 3b1b06570cf9 by Victor Stinner in branch '2.7': Issue #12016: my_fgets() now always clears errors before calling fgets(). Fix http://hg.python.org/cpython/rev/3b1b06570cf9 New changeset de07f90ef45c by Victor Stinner in branch '3.2': Issue #12016: my_fgets() now always clears errors before calling fgets(). Fix http://hg.python.org/cpython/rev/de07f90ef45c New changeset deb6e7859211 by Victor Stinner in branch 'default': (Merge 3.2) Issue #12016: my_fgets() now always clears errors before calling http://hg.python.org/cpython/rev/deb6e7859211 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Roundup Robot devnull@devnull added the comment: New changeset b40dac6390a9 by Victor Stinner in branch '2.7': Issue #1195: fix the issue number of the NEWS entry http://hg.python.org/cpython/rev/b40dac6390a9 New changeset d780ca579e6f by Victor Stinner in branch '3.2': Issue #1195: fix the issue number of the NEWS entry http://hg.python.org/cpython/rev/d780ca579e6f New changeset 29e61c4ba59f by Victor Stinner in branch 'default': (Merge 3.2) Issue #1195: fix the issue number of the NEWS entry http://hg.python.org/cpython/rev/29e61c4ba59f -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
STINNER Victor victor.stin...@haypocalc.com added the comment: The patch still does not handle the case where the eof indicator is already set when calling raw_input. My original patch does. I commited your original patch but I kept mine because it doesn't hurt to clear the error on EOF at exit. Reopen the issue if it still doesn't work in all cases. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Ralf Schmitt sch...@gmail.com added the comment: Either you clearerr or you can't rely on feof. fgets might also set the end of file indicator *and* return valid data. I don't see a reason to not call clearerr right before trying to read from the stream. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Roundup Robot devnull@devnull added the comment: New changeset fa3227c3cf87 by Victor Stinner in branch '3.1': Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c, http://hg.python.org/cpython/rev/fa3227c3cf87 New changeset b5914bfb4d04 by Victor Stinner in branch '3.2': Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c, clear http://hg.python.org/cpython/rev/b5914bfb4d04 New changeset 3ff5d28ab630 by Victor Stinner in branch 'default': (Merge 3.2) Issue #1195: Fix input() if it is interrupted by CTRL+d and then http://hg.python.org/cpython/rev/3ff5d28ab630 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Roundup Robot devnull@devnull added the comment: New changeset c9f07c69b138 by Victor Stinner in branch '2.7': (Merge 3.1) Issue #1195: Fix input() if it is interrupted by CTRL+d and then http://hg.python.org/cpython/rev/c9f07c69b138 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
STINNER Victor victor.stin...@haypocalc.com added the comment: It should be fixed. Reopen the issue if it doesn't work, I only tested on Linux. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Ralf Schmitt sch...@gmail.com added the comment: The patch still does not handle the case where the eof indicator is already set when calling raw_input. My original patch does. Run the following program and hit ctrl-d, then ctrl-c: import sys sys.stdin.read() while True: try: s = raw_input(' ') except: pass -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
STINNER Victor victor.stin...@haypocalc.com added the comment: The patch still does not handle the case where the eof indicator is already set when calling raw_input. My original patch does. Correct, your example fails, but only in Python 2.7. I don't like the idea of always clearing errors. I prefer to reset stdin only after an error or EOF. Attached patch changes file.read() to clear the EOF flag if the read was stopped because of the EOF. -- Added file: http://bugs.python.org/file21949/clear_eof.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
STINNER Victor victor.stin...@haypocalc.com added the comment: Instead of always calling clearerr(), we can only call it on EOF: diff -r 88fe1ac48460 Parser/myreadline.c --- a/Parser/myreadline.c Mon Mar 07 08:31:52 2011 +0100 +++ b/Parser/myreadline.c Fri Mar 18 10:57:23 2011 +0100 @@ -72,6 +72,7 @@ } #endif /* MS_WINDOWS */ if (feof(fp)) { +clearerr(fp); return -1; /* EOF */ } #ifdef EINTR This patch works around this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Vetoshkin Nikita nikita.vetosh...@gmail.com added the comment: up! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Changes by Éric Araujo mer...@netwok.org: -- nosy: +haypo -BreamoreBoy versions: +Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Changes by Finkregh finkr...@mafia-server.net: -- nosy: +Finkregh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Vetoshkin Nikita nikita.vetosh...@gmail.com added the comment: Confirming that issue is present in latest svn checkout and Ralf's fix helps. -- nosy: +nvetoshkin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Changes by Éric Araujo mer...@netwok.org: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Changes by Jeong-Min Lee false...@gmail.com: -- nosy: +falsetru ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Mark Lawrence breamore...@yahoo.co.uk added the comment: There's a one line patch in msg59242, could someone please take a look. Apparantly py3k is not affected by this issue although I haven't tried it myself. -- nosy: +BreamoreBoy stage: unit test needed - patch review versions: +Python 2.7 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Daniel Diniz aja...@gmail.com added the comment: Confirmed in trunk, doesn't seem to affect py3k. -- keywords: +patch nosy: +ajaksu2 stage: - test needed versions: +Python 2.6 -Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1195 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
New submission from Rebecca Breu: Run the program: while True: try: s = raw_input(' ') except: pass Press Ctrl-D and then Ctrl-C, and you get Traceback (most recent call last): File test.py, line 5, in ? s = raw_input(' ') KeyboardInterrupt Pressing just Ctrl-D or Ctrl-C continues the loop as expected, Ctrl-D after Ctrl-C works, too. Only Ctrl-C after Ctrl-D sucks, even when you try to catch EOFError and KeybordInterrupt explicitly. The problem occurs with Python 2.4 and 2.5 on Debian testing, friends confirmed the error under Ubuntu/2.5 and Gentoo/?. The error does not occur when you import readline first. Ah, and by the way: http://docs.python.org/lib/reporting-bugs.html still links to the sourceforce bucktracker. -- components: None messages: 56109 nosy: Rebecca severity: normal status: open title: Problems on Linux with Ctrl-D and Ctrl-C during raw_input versions: Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1195 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Georg Brandl added the comment: There are a few other issues about raw_input and signals in the tracker, possibly this is just another incarnation... The docs tracker link is fixed, but needs a rebuild on the server. -- nosy: +georg.brandl __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1195 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1195] Problems on Linux with Ctrl-D and Ctrl-C during raw_input
Changes by Sean Reifschneider: -- components: +Library (Lib) -None priority: - normal type: - behavior __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1195 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com