Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test setup failures with Bash 5.1: AssertionError: '\x1b[?2004l\r\x1b[?2004h' != '' #337

Closed
hroncok opened this issue Jan 11, 2021 · 5 comments · Fixed by #379
Closed

Test setup failures with Bash 5.1: AssertionError: '\x1b[?2004l\r\x1b[?2004h' != '' #337

hroncok opened this issue Jan 11, 2021 · 5 comments · Fixed by #379

Comments

@hroncok
Copy link
Contributor

hroncok commented Jan 11, 2021

Hello. In Fedora Rawhide (development branch), we have updated to Bash 5.1. The tests here fail to setup with:

======================================================================
FAIL: test_comp_point (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_completion_environment (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_continuation (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_debug_output (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_double_quoted_completion (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_exclamation_in_double_quotes (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_one_space_after_exact (test.test.TestBash)
Test exactly one space is appended after an exact match.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_parse_special_characters (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_parse_special_characters_dollar (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_partial_completion (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_quoted_exact (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_quoted_space (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_quotes (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_simple_completion (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_single_quoted_completion (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_single_quotes_in_double_quotes (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_single_quotes_in_single_quotes (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_special_characters (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_special_characters_double_quoted (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_special_characters_single_quoted (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_temp_file (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_unquoted_space (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_wordbreak_chars (test.test.TestBash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_comp_point (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_completion_environment (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_console_script_module (test.test.TestBashGlobal)
Test completing a console_script for a module.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_console_script_module_wheel (test.test.TestBashGlobal)
Test completing a console_script for a module from a wheel.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_console_script_package (test.test.TestBashGlobal)
Test completing a console_script for a package.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_console_script_package_wheel (test.test.TestBashGlobal)
Test completing a console_script for a package from a wheel.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_continuation (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_debug_output (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_double_quoted_completion (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_exclamation_in_double_quotes (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_one_space_after_exact (test.test.TestBashGlobal)
Test exactly one space is appended after an exact match.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_parse_special_characters (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_parse_special_characters_dollar (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_partial_completion (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_python_completion (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_python_filename_completion (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_python_module (test.test.TestBashGlobal)
Test completing a module run with python3 -m.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_python_not_executable (test.test.TestBashGlobal)
Test completing a script that cannot be run directly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_quoted_exact (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_quoted_space (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_quotes (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_simple_completion (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_single_quoted_completion (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_single_quotes_in_double_quotes (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_single_quotes_in_single_quotes (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_special_characters (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_special_characters_double_quoted (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_special_characters_single_quoted (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_temp_file (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_unquoted_space (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

======================================================================
FAIL: test_wordbreak_chars (test.test.TestBashGlobal)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/argcomplete-1.12.0/test/test.py", line 1206, in setUp
    self.assertEqual(output, '')
AssertionError: '\x1b[?2004l\r\x1b[?2004h' != ''
- 

----------------------------------------------------------------------
Ran 144 tests in 84.144s

FAILED (failures=54, skipped=2, expected failures=9)

I unfortunately fail to reproduce this outside of our build environment :(

We have 1.12.0.

@hroncok
Copy link
Contributor Author

hroncok commented Jan 11, 2021

Apparently, this has something to do with bracketed paste mode which has been enabled by default in Bash 5.1.

@hroncok
Copy link
Contributor Author

hroncok commented Jan 11, 2021

Most likely a problem in pexpect pexpect/pexpect#669

@kislyuk
Copy link
Owner

kislyuk commented Jan 11, 2021

Thanks for tracking this, we'll wait to see how the pexpect maintainers react and bump the required version as appropriate. If there's a workaround available for how to configure pexpect, let us know.

@hroncok
Copy link
Contributor Author

hroncok commented Feb 2, 2021

In Fedora, I've applied this workaround:

echo "set enable-bracketed-paste off" > .inputrc
export INPUTRC=$PWD/.inputrc

Since pexpect is used in tests only, I know that this is safe: Users of argcomplete with bracketed-paste enabled won't get the extra escape sequences from argcomplete.

@tony
Copy link
Contributor

tony commented Oct 22, 2022

Similarly, I ran into this.

This workaround helped

echo "set enable-bracketed-paste off" > .inputrc
export INPUTRC=$PWD/.inputrc

But that's really not enough. This should be working out of the box for users.

This is creating a huge barrier for users who want to contribute basic things. They'll be blocked by this and burn precious time - if that lost time can be avoided - we should make it a default setting in the test

tony added a commit to tony/argcomplete that referenced this issue Oct 22, 2022
tony added a commit to tony/argcomplete that referenced this issue Oct 22, 2022
tony added a commit to tony/argcomplete that referenced this issue Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants