[issue13051] Infinite recursion in curses.textpad.Textbox

2017-03-31 Thread Donald Stufft

Changes by Donald Stufft :


--
pull_requests: +947

___
Python tracker 

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2016-12-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Tycho.

--
resolution:  -> fixed
stage: patch 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



[issue13051] Infinite recursion in curses.textpad.Textbox

2016-12-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b446a4aab9cf by Serhiy Storchaka in branch '3.5':
Issue #13051: Fixed recursion errors in large or resized curses.textpad.Textbox.
https://hg.python.org/cpython/rev/b446a4aab9cf

New changeset d87771d1c1e6 by Serhiy Storchaka in branch '2.7':
Issue #13051: Fixed recursion errors in large or resized curses.textpad.Textbox.
https://hg.python.org/cpython/rev/d87771d1c1e6

New changeset ea87e00a3e89 by Serhiy Storchaka in branch '3.6':
Issue #13051: Fixed recursion errors in large or resized curses.textpad.Textbox.
https://hg.python.org/cpython/rev/ea87e00a3e89

New changeset ea7f22cf9c8c by Serhiy Storchaka in branch 'default':
Issue #13051: Fixed recursion errors in large or resized curses.textpad.Textbox.
https://hg.python.org/cpython/rev/ea7f22cf9c8c

--
nosy: +python-dev

___
Python tracker 

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2016-12-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2016-12-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I can reproduce the second bug too.

Here is updated patch. The main difference is that it preserves maxx and maxy 
attributes and support them up to date.

--
Added file: http://bugs.python.org/file45945/textpad-recursion-fix2.patch

___
Python tracker 

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2016-12-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2016-12-16 Thread Berker Peksag

Berker Peksag added the comment:

The patch doesn't apply cleanly anymore so the next step would be to provide an 
updated patch.

By the way, I can reproduce the first bug, but not the second one. If the 
second bug can't be reproducible anymore, we might need a simpler patch.

--
nosy: +berker.peksag
type: crash -> behavior
versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.2

___
Python tracker 

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2016-12-16 Thread David Andersen

David Andersen added the comment:

Any progress on this? Its Dec 2016 and this bug is still around. There's a 
patch and a patch with tests. The problem is well-understood. I'm not sure what 
the holdup is, but it would be great to get fixed!

--
nosy: +rxcomm

___
Python tracker 

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2012-01-25 Thread Tycho Andersen

Tycho Andersen ty...@tycho.ws added the comment:

Hi, any movement on this?

--

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2011-12-20 Thread Tycho Andersen

Tycho Andersen ty...@tycho.ws added the comment:

Attached is a patch which contains a testcase as well. A few notes about this 
testcase:

1. I couldn't figure out how to get it to run correctly after all the other 
tests had run, so I had to run it first. This seems lame. One possible fix is 
to run each testcase in curses.wrapper; I'd be happy to change this patch to do 
that if it's more acceptable.

2. This testcase only tests one of the two bugs this patch fixes. The other 
seems much harder to write a testcase for, since you have to have a terminal 
such that curses.LINES * curses.COLUMS  sys.getrecursionlimit(). If there's a 
good way to guarantee this, I'd be happy to write a testcase for it.

Comments are appreciated!

--
Added file: http://bugs.python.org/file24061/textpad-recursion-fix.patch

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2011-12-19 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +haypo
stage:  - patch review

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2011-12-19 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

Would you be able to produce a unit test which fails before your patch is 
applied, but succeeds after applying your changes? That'll make your changes 
more likely to get accepted.

--
nosy: +brian.curtin

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



[issue13051] Infinite recursion in curses.textpad.Textbox

2011-09-27 Thread Tycho Andersen

New submission from Tycho Andersen ty...@tycho.ws:

The attached patch fixes two bugs which manifest as infinite recursion in 
_insert_printable_char() of Textbox. First, the previous implementation of 
_insert_printable_char() used recursion to move characters when inserting a 
character. Thus, any Textpad which had an area greater than the interpreter's 
maximum recursion limit would crash. A minimal test case is the following:

#!/usr/bin/python
import curses
from curses.textpad import Textbox

def main(stdscr):
box = Textbox(stdscr, insert_mode=True)
box.stripspaces = True
while 1:
cmd = box.edit()
if cmd == 'q':
break

curses.wrapper(main)

Run that script in a terminal with area (i.e. $LINES * $COLUMNS)  1000 (the 
default max recursion limit), press any key and be greeted by a stack trace. 
The patch changes the implementation of _insert_printable_char() to be 
iterative, thus avoiding the infinite recursion.

Second, when the underlying curses window was resized to be smaller than it was 
when the Textpad was created, pressing any key would result in infinite 
recursion (or with the new method, an infinite loop). The patch also changes 
Textpad so that instead of keeping the underlying window's size as instance 
attributes of this Textpad, Textpad asks the underlying window its size every 
time Textpad needs to know, allowing the underlying window to be resized at 
will.

I've verified this bug is in 2.7.1 and 3.2. Let me know if you need anything 
else.

--
components: Library (Lib)
files: textpad_resize.patch
keywords: patch
messages: 144559
nosy: tycho
priority: normal
severity: normal
status: open
title: Infinite recursion in curses.textpad.Textbox
type: crash
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file23249/textpad_resize.patch

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