[Patches] [ python-Patches-1093585 ] sanity check for readline remove/replace

SourceForge.net noreply at sourceforge.net
Fri Jan 21 03:20:03 CET 2005


Patches item #1093585, was opened at 2004-12-31 11:22
Message generated for change (Comment added) made by mdehoon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1093585&group_id=5470

Category: Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: DSM (dsm001)
Assigned to: Nobody/Anonymous (nobody)
Summary: sanity check for readline remove/replace

Initial Comment:
Fix bug 1086603 (segfault in readline) by checking for
negative input indices in remove_history_item and
replace_history_item; GNU code doesn't always return NULL.

----------------------------------------------------------------------

Comment By: Michiel de Hoon (mdehoon)
Date: 2005-01-21 11:20

Message:
Logged In: YES 
user_id=488897

I have run the test suite after applying this patch, and I
found no problems with it. The bug does indeed originate in
the readline library, which does not return NULL if the
index is negative. I sent a patch to bug-readline at gnu.org,
so this will probably be fixed in future versions of
readline. But I agree that for now, we need a workaround in
Python.
Note that there is one more way to fix this bug, which is to
interpret negative indeces as counting from the end. So
remove_history_item(-1) removes the last item added to the
history etc. This would be more consistent with lists etc.
in Python, and users may even expect this behavior.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1093585&group_id=5470


More information about the Patches mailing list