changeset: 98333:48943533965e parent: 98329:af46be655a2e parent: 98332:0d3b64bbc82c user: Serhiy Storchaka date: Sun Sep 27 22:38:33 2015 +0300 files: Misc/NEWS Modules/readline.c description: Issue #25203: Failed readline.set_completer_delims() no longer left the module in inconsistent state. diff -r af46be655a2e -r 48943533965e Misc/NEWS --- a/Misc/NEWS Sun Sep 27 12:37:20 2015 -0400 +++ b/Misc/NEWS Sun Sep 27 22:38:33 2015 +0300 @@ -146,6 +146,9 @@ Library ------- +- Issue #25203: Failed readline.set_completer_delims() no longer left the + module in inconsistent state. + - Issue #23329: Allow the ssl module to be built with older versions of LibreSSL. diff -r af46be655a2e -r 48943533965e Modules/readline.c --- a/Modules/readline.c Sun Sep 27 12:37:20 2015 -0400 +++ b/Modules/readline.c Sun Sep 27 22:38:33 2015 +0300 @@ -464,10 +464,11 @@ /* Keep a reference to the allocated memory in the module state in case some other module modifies rl_completer_word_break_characters (see issue #17289). */ - free(completer_word_break_characters); - completer_word_break_characters = strdup(break_chars); - if (completer_word_break_characters) { - rl_completer_word_break_characters = completer_word_break_characters; + break_chars = strdup(break_chars); + if (break_chars) { + free(completer_word_break_characters); + completer_word_break_characters = break_chars; + rl_completer_word_break_characters = break_chars; Py_RETURN_NONE; } else