Calysto / metakernel

Jupyter/IPython Kernel Tools
BSD 3-Clause "New" or "Revised" License
342 stars 84 forks source link

Test failure with readline library version 8.1 #228

Open ellert opened 3 years ago

ellert commented 3 years ago

After upgrading the readline library to version 8.1 the following test failure started to appear:

=================================== FAILURES ===================================
_________________________ REPLWrapTestCase.test_python _________________________

self = <metakernel.tests.test_replwrap.REPLWrapTestCase testMethod=test_python>

    def test_python(self):
        if platform.python_implementation() == 'PyPy':
            raise unittest.SkipTest("This test fails on PyPy because of REPL differences")

        p = replwrap.python(sys.executable)
        res = p.run_command('4+7')
>       assert res.strip() == '11'
E       AssertionError: assert '\x1b[?2004l\...\n\x1b[?2004h' == '11'
E         - 11
E         + 
E         + 11
E         + 

/builddir/build/BUILD/metakernel-0.27.5/metakernel/tests/test_replwrap.py:81: AssertionError

Downgrading to readline version 8.0 makes the failure go away.

anewusername commented 2 years ago

Per pexpect/pexpect#669 this is unlikely to be fixed upstream, but it is having some impact downstream already ( blink1073/oct2py#237 and blink1073/oct2py#248 ).

Would REPLWrapper.run_command() be a reasonable place to check for and strip any bracketing?

blink1073 commented 2 years ago

Would REPLWrapper.run_command() be a reasonable place to check for and strip any bracketing?

Sounds right to me