summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS3
-rw-r--r--Modules/readline.c17
2 files changed, 18 insertions, 2 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index c486a59..37a2333 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -20,6 +20,9 @@ Core and Builtins
Library
-------
+- Issue $9907: Fix tab handling on OSX when using editline by calling
+ rl_initialize first, then setting our custom defaults, then reading .editrc.
+
- Issue #4188: Avoid creating dummy thread objects when logging operations
from the threading module (with the internal verbose flag activated).
diff --git a/Modules/readline.c b/Modules/readline.c
index 466ec51..8337956 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -889,6 +889,14 @@ setup_readline(void)
Py_FatalError("not enough memory to save locale");
#endif
+#ifdef __APPLE__
+ /* the libedit readline emulation resets key bindings etc
+ * when calling rl_initialize. So call it upfront
+ */
+ if (using_libedit_emulation)
+ rl_initialize();
+#endif /* __APPLE__ */
+
using_history();
rl_readline_name = "python";
@@ -920,8 +928,13 @@ setup_readline(void)
* XXX: A bug in the readline-2.2 library causes a memory leak
* inside this function. Nothing we can do about it.
*/
- rl_initialize();
-
+#ifdef __APPLE__
+ if (using_libedit_emulation)
+ rl_read_init_file(NULL);
+ else
+#endif /* __APPLE__ */
+ rl_initialize();
+
RESTORE_LOCALE(saved_locale)
}