This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients gumnos, martin.panter, vstinner
Date 2016-06-21.05:19:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1466486386.89.0.290196967283.issue25259@psf.upfronthosting.co.za>
In-reply-to
Content
I think Victor may be on the right track. Since the macro contains two newlines, a single call to rl_callback_read_char() is going to produce two calls back to the rl_callback_handler_install() handler to receive each line.

I can make the example from the Readline documentation <https://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC43> crash the same way that Python does. First, add a macro to ~/.inputrc, which causes an exclamation mark (!) to enter two lines at once:

"!": "exit\ncrash\n"

Now, typing an exclamation mark will cause the example program (and Python!) to crash.

In the description of rl_callback_read_char() <https://cnswww.cns.cwru.edu/php/chet/readline/readline.html#IDX335>, it says “If the ‘lhandler’ function returns . . .”. That seems to be hinting at using something like setjmp() to avoid the function returning, which might help, but I am not sure.
History
Date User Action Args
2016-06-21 05:19:46martin.pantersetrecipients: + martin.panter, vstinner, gumnos
2016-06-21 05:19:46martin.pantersetmessageid: <1466486386.89.0.290196967283.issue25259@psf.upfronthosting.co.za>
2016-06-21 05:19:46martin.panterlinkissue25259 messages
2016-06-21 05:19:46martin.pantercreate