[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-03-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Martin.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-03-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks for fixing this!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-03-22 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-03-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af6e8e1d15fa by Martin Panter in branch '3.5':
Issue #24266: Cancel history search mode with Ctrl+C in Readline 7
https://hg.python.org/cpython/rev/af6e8e1d15fa

New changeset 322d30816d36 by Martin Panter in branch 'default':
Issue #24266: Merge readline Ctrl+C handling from 3.5
https://hg.python.org/cpython/rev/322d30816d36

New changeset 1c0b29441116 by Martin Panter in branch '2.7':
Issue #24266: Cancel history search mode with Ctrl+C in Readline 7
https://hg.python.org/cpython/rev/1c0b29441116

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-03-22 Thread Martin Panter

Martin Panter added the comment:

I’m getting ready to commit my patch to support the new Readline 7 function. Is 
there anything else to be done? The other options don’t sound worth it to me 
(e.g. incomplete, depending on internal details, etc).

--
stage: patch review -> commit review
versions:  -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-01-31 Thread Thomas Caswell

Thomas Caswell added the comment:

For reference https://github.com/ludwigschwardt/python-gnureadline/pull/47 is 
what a back-port of the functionality looks like.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2016-01-31 Thread Thomas Caswell

Thomas Caswell added the comment:

I do not think that readline-cancel.patch is sufficient. The clean up function 
that readline uses internally 
(http://git.savannah.gnu.org/cgit/readline.git/tree/isearch.c#n720 ) also 
cleans up the context that used by isearch.

The functions to cleanup the context (and a pointer to the context) are exposed 
on `rlprivate.h` so python _can_ get at them to support old versions of rl. 
Once started down that path for isearch mode, might as well vendor all of 
rl_callback_sigcleanup() which will end up being 50-100 LoC (some of the helper 
functions will also need to be vendored).

--
nosy: +tcaswell

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-07-29 Thread Martin Panter

Martin Panter added the comment:

Readline 7.0 alpha version includes a new “feature” that should help:

i.  rl_callback_sigcleanup: a new application function that can clean up and 
unset any state set by readline’s callback mode.  Intended to be used after a 
signal.

Patch readline-sigcleanup.patch uses this function, depending on a compile-time 
version check. It fixes the bug when compiled against Readline 7.

--
stage: test needed - patch review
Added file: http://bugs.python.org/file40054/readline-sigcleanup.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-06-02 Thread sping

sping added the comment:

I guess supporting older upstream versions would be nice in this case.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-06-02 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-06-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The patch is two lines, but I do not know our general policy for working around 
bugs in external modules.  I do know that Idle has workarounds for tk bugs (or 
'os-dependencies').

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-06-02 Thread R. David Murray

R. David Murray added the comment:

I believe that in general we do do workarounds if they don't make the code too 
complicated and upstream hasn't solved the problem (or we need to support older 
upstream versions).

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-05-27 Thread Martin Panter

Martin Panter added the comment:

I reported this to Gnu Readline: 
https://lists.gnu.org/archive/html/bug-readline/2015-05/msg00014.html. So far 
it sounds like there is no general solution. I am posting a patch implementing 
Sebastian’s workaround. But my personal philosophy is to leave Python alone if 
it is not doing anything wrong and this is indeed a Readline bug.

Chet also pointed out that there are other modes in addition to incremental 
search that are not cancelled. For instance, the “argument” mode where you 
press Alt+number etc.

--
keywords: +patch
Added file: http://bugs.python.org/file39514/readline-cancel.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-05-24 Thread Martin Panter

Martin Panter added the comment:

I suspect this is actually a bug with Gnu Readline. The same issue exists in 
GDB.

When a signal handler (such as SIGINT) raises an exception to abort the input, 
Python calls rl_free_line_state(). The documentation for that function, 
https://cnswww.cns.cwru.edu/php/chet/readline/readline.html#IDX341 says 
Readline’s own SIGINT handler (which Python doesn’t normally actually use) also 
calls it to abort the current line. It lists various states that are “freed”. 
Although the search state is not in the list, it seems like it should be.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-05-22 Thread Martin Panter

Martin Panter added the comment:

Also applies to the interactive interpreter mode.

--
nosy: +vadmium

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-05-22 Thread Terry J. Reedy

Terry J. Reedy added the comment:

3.2 and 3.3 only get security fixes.  I condensed the title to be visible in 
display boxes.  It would help if you signed the PSF Contributor Agreement
https://www.python.org/psf/contrib/
https://www.python.org/psf/contrib/contrib-form/
and contributed a usable patch for test_readline under that agreement.

--
nosy: +terry.reedy, twouters
stage:  - test needed
title: raw_input function (with readline): Ctrl+C (during search mode but not 
only) leaves readline in broken state - raw_input + readline: Ctrl+C during 
search breaks readline
versions:  -Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24266] raw_input + readline: Ctrl+C during search breaks readline

2015-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This behavior annoyed me long time, but I had no idea how to fix this.

--
nosy: +pitrou, serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24266
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com