stefanholek added the comment:
Thank you Antoine, this looks good.
However when I try your example I get
sys.stdin = io.TextIOWrapper(
sys.stdin.detach(), 'ascii', 'replace')
ValueError: underlying buffer has been detached
--
__
stefanholek added the comment:
I am not quite sure how I would write a custom, readline-using input function
in Python (access to PyOS_Readline seems required), that's why I did it in C.
Have an example?
--
___
Python tracker
New submission from stefanholek :
The input builtin always uses "strict" error handling for Unicode conversions.
This means that when I enter a latin-1 string in a utf-8 environment, input
breaks with a UnicodeDecodeError. Now don't tell me not to do that, I have a
valid use-c
stefanholek added the comment:
These undo lists come into existence when history entries are edited
interactively (Arrow-Up, edit line, Arrow-Up, edit line, Enter -> undo list of
first history entry leaks).
--
components: +Extension Modules
versions: +Python 2.6, Python 2.7, Pyt
New submission from stefanholek :
This is a continuation of issue #9450.
The 'data' element of a history entry may point to an undo list for the entry.
When freeing the entry the associated undo list must be freed as well, and
'free(data)' alone does not cut it. I have not
stefanholek added the comment:
I have read the readline source code, and it does mean just that. :-)
Anyway, this does not really apply to the stdlib because unless someone
implements 'stifle_history' and friends 'history_base' is going t
stefanholek added the comment:
To be zero-based, get_history_item would need to look like:
diff --git a/rl/readline.c b/rl/readline.c
index 33e9905..800bc00 100644
--- a/rl/readline.c
+++ b/rl/readline.c
@@ -559,7 +559,7 @@ get_history_item(PyObject *self, PyObject *args)
if