Message 149813 - Python tracker (original) (raw)

Problem

The changes in r87356 for py3k and r87358 for python-2.7 described in issue 9907 have broken parsing of the initialization file .editrc under editline emulation of readline on Mac OS X.

Background

Both readline and editline allow settings customized per program. For example, .inputrc file for readline::

$if Python
    set editing-mode vi
$endif

will be applied only to Python processes.

Similarly, .editrc file for editline::

python:bind -v
python:bind ^I rl_complete

will be applied only to Python processes on Mac OS X.

This works fine on python-2.6.

It's broken on 2.7 and 3.2 and later because the change in issue 9907 moved the rl_initialize() call towards the beginning of the setup function.

Solution

The rl_readline_name variable must be set to "python" before the call to rl_initialize(). Attached are patches for 2.7 and 3.2.