Skip to content

Commit

Permalink
Work around trailing null characters in zsh (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanunderscore authored Nov 27, 2023
1 parent 9862df4 commit 59baed5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ def run_command(self, command, **kwargs):
raise Exception("Expected to see a newline in command response")
echo_cmd, actual_res = res.split("\n", 1)
res_without_ansi_seqs = re.sub(r"\x1b\[0m.+\x1b\[J", "", actual_res)
return res_without_ansi_seqs
# Unsure why some environments produce trailing null characters,
# but they break tests and trimming them seems to be harmless.
# https://github.com/kislyuk/argcomplete/issues/447
res_without_null_chars = res_without_ansi_seqs.rstrip("\x00")
return res_without_null_chars
else:
return res

Expand Down

0 comments on commit 59baed5

Please sign in to comment.