kislyuk / argcomplete

Python and tab completion, better together.
https://kislyuk.github.io/argcomplete/
Apache License 2.0
1.39k stars 129 forks source link

zsh test failures on Fedora #447

Closed stratakis closed 7 months ago

stratakis commented 10 months ago

Hello,

I'm working on an update to the argcomplete Fedora package from 2.0.0 to 3.1.1. When running the tests with python3 test/test.py I'm getting the following errors with zsh-5.9:

Errors ====================================================================== FAIL: test_comp_point (__main__.TestZsh.test_comp_point) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_completion_environment (__main__.TestZsh.test_completion_environment) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_continuation (__main__.TestZsh.test_continuation) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_double_quoted_completion (__main__.TestZsh.test_double_quoted_completion) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_exclamation_in_double_quotes (__main__.TestZsh.test_exclamation_in_double_quotes) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_parse_special_characters (__main__.TestZsh.test_parse_special_characters) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_parse_special_characters_dollar (__main__.TestZsh.test_parse_special_characters_dollar) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_partial_completion (__main__.TestZsh.test_partial_completion) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_quoted_exact (__main__.TestZsh.test_quoted_exact) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_quoted_space (__main__.TestZsh.test_quoted_space) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_quotes (__main__.TestZsh.test_quotes) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_simple_completion (__main__.TestZsh.test_simple_completion) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_single_quoted_completion (__main__.TestZsh.test_single_quoted_completion) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_single_quotes_in_double_quotes (__main__.TestZsh.test_single_quotes_in_double_quotes) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_single_quotes_in_single_quotes (__main__.TestZsh.test_single_quotes_in_single_quotes) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_special_characters (__main__.TestZsh.test_special_characters) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_special_characters_double_quoted (__main__.TestZsh.test_special_characters_double_quoted) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_special_characters_single_quoted (__main__.TestZsh.test_special_characters_single_quoted) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_unquoted_space (__main__.TestZsh.test_unquoted_space) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ====================================================================== FAIL: test_wordbreak_chars (__main__.TestZsh.test_wordbreak_chars) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.1/test/test.py", line 1255, in setUp self.assertEqual(output, "") AssertionError: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\[807 chars]\x00' != '' - ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� ----------------------------------------------------------------------
kislyuk commented 9 months ago

Thanks for the report. This looks very mysterious, as the error message appears inconsistent. The line that is failing compares a string to an empty string, but the two printed strings asserted not equal are not empty. It looks like the testing environment is corrupted somehow.

Also, this looks like pytest output. Argcomplete does not support pytest - please use unittest and remove any customizations that improperly force the use of pytest.

kislyuk commented 9 months ago

I am going to close this issue for now as it appears to be using an unsupported test configuration. If you find that this error reproduces when running with regular unittest, please post the exact command line that is used to invoke the test, and I will try to reproduce it again. Thank you for helping package argcomplete!

penguinpee commented 7 months ago

This still happens for all zsh tests in our confined build environment for argcomplete 3.1.4. Please note, that pytest is not installed in the buildroot. This is how the command is run including some environment prep that is part of the process.

CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64   -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
PATH=/builddir/build/BUILDROOT/python-argcomplete-3.1.4-4.fc40.x86_64/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
PYTHONPATH=/builddir/build/BUILDROOT/python-argcomplete-3.1.4-4.fc40.x86_64/usr/lib64/python3.12/site-packages:/builddir/build/BUILDROOT/python-argcomplete-3.1.4-4.fc40.x86_64/usr/lib/python3.12/site-packages
PYTHONDONTWRITEBYTECODE=1
PYTEST_ADDOPTS=' --ignore=/builddir/build/BUILD/argcomplete-3.1.4/.pyproject-builddir'
PYTEST_XDIST_AUTO_NUM_WORKERS=8
/usr/bin/python3 test/test.py -v

Notably, all works fine when running the same command in a venv locally. I can trigger a scratch build if you'd like a look at the complete build output.

penguinpee commented 7 months ago

In an attempt to narrow it down, I also tried a build in an older release with Python 3.11.6 and zsh 5.9. It fails in the same fashion.

Above output is from a run with Python 3.12.0 and the same zsh version. I saw that tests in Ubuntu use zsh 5.8. I will try with that version, if I can. All currently supported Fedora releases have zsh 5.9.

penguinpee commented 7 months ago

For the record: with zsh 5.8 and Python 3.11.6 it also failed.

Thanks for re-opening. Let me know if you need more information or if I can assist in any other way.

evanunderscore commented 7 months ago

The issue looks like the tests are expecting an empty string but the command is producing a whole bunch of null characters.

I've added some additional checks in #464 that should give us a better idea of what's going on. Are you able to retest on that branch and show the output please?

penguinpee commented 7 months ago

Thank you for taking a look at this. With the patch applied the output looks as follows.

test output

```python ====================================================================== FAIL: test_double_quoted_completion (__main__.TestZsh.test_double_quoted_completion) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_exclamation_in_double_quotes (__main__.TestZsh.test_exclamation_in_double_quotes) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_partial_completion (__main__.TestZsh.test_partial_completion) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_quoted_exact (__main__.TestZsh.test_quoted_exact) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_quoted_space (__main__.TestZsh.test_quoted_space) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_quotes (__main__.TestZsh.test_quotes) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_simple_completion (__main__.TestZsh.test_simple_completion) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_single_quoted_completion (__main__.TestZsh.test_single_quoted_completion) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_single_quotes_in_double_quotes (__main__.TestZsh.test_single_quotes_in_double_quotes) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_single_quotes_in_single_quotes (__main__.TestZsh.test_single_quotes_in_single_quotes) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_special_characters (__main__.TestZsh.test_special_characters) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_special_characters_double_quoted (__main__.TestZsh.test_special_characters_double_quoted) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_special_characters_single_quoted (__main__.TestZsh.test_special_characters_single_quoted) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ====================================================================== FAIL: test_unquoted_space (__main__.TestZsh.test_unquoted_space) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/argcomplete-3.1.6/test/test.py", line 1255, in setUp self.assertEqual(output, "ready\r\n") AssertionError: 'ready\r\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' != 'ready\r\n' ready - + ---------------------------------------------------------------------- Ran 127 tests in 64.260s FAILED (failures=14, skipped=6, expected failures=5) ```

evanunderscore commented 7 months ago

I have no idea why those trailing null characters are there, but since it seems this is somehow related to the test setup and not the code itself, it might be safe to just strip them. Can you try https://github.com/kislyuk/argcomplete/commit/9c022cb2addcc3fb92fedc5ac10c9266bd816207 for me please?

penguinpee commented 7 months ago

Yes, that works! :tada:

evanunderscore commented 7 months ago

One more thing I'd like to check before merging this workaround - what version of pexpect are you using? Is it the same on your host (where it's failing) and in the virtual environment (where it's passing)? If they're different, does upgrading on your host or downgrading in your virtual environment change the result?

penguinpee commented 7 months ago

Both, in the chroot and on my system, pexpect is version 4.8.0.

evanunderscore commented 7 months ago

Okay, in that case I'll just merge the workaround. Thanks for the report!