]> git.ipfire.org Git - thirdparty/zstd.git/commit
Fix a Python bytes/int mismatch in CLI tests
authorPeter Pentchev <roam@ringlet.net>
Sat, 18 Mar 2023 20:32:42 +0000 (22:32 +0200)
committerNick Terrell <nickrterrell@gmail.com>
Mon, 20 Mar 2023 18:17:43 +0000 (11:17 -0700)
commit29b8a3d8f2bdd26d6952d5bdb62708aab591e1ae
tree40fa7c40b2a14ffe2396cdd0a4b579085f891317
parente2208242ac4b87e95ecc8387c7be8a4986e94551
Fix a Python bytes/int mismatch in CLI tests

In Python 3.x, a single element of a bytes array is returned as
an integer number. Thus, NEWLINE is an int variable, and attempting
to add it to the line array will fail with a type mismatch error
that may be demonstrated as follows:

    [roam@straylight ~]$ python3 -c 'b"hello" + b"\n"[0]'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    TypeError: can't concat int to bytes
    [roam@straylight ~]$
tests/cli-tests/run.py