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

3.3.0 parametrized node IDs are not ACSII escaped :: breaks PYTEST_CURRENT_TEST in Python 3 #2957

Closed
mattsb42-aws opened this issue Nov 28, 2017 · 8 comments
Labels
status: critical grave problem or usability issue that affects lots of users topic: reporting related to terminal output and user-facing messages and errors type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously

Comments

@mattsb42-aws
Copy link

Problem

With 3.3.0, it appears that there were some conflicting changes in the formatting of parametrized node IDs which results in errors in Python 3 if the parametrized values contain null bytes.

I noticed this behavior because setting the PYTEST_CURRENT_TEST environment variable now fails in Python 3 in this scenario. Digging deeper, it appears that the immediate reason for this error is this commit that indicates that ascii escaping is no longer necessary because it is sanitized during the parametrization process.

However, looking at the values that it attempts to write to the environment variable and the formatted names for the parametrized tests, it would appear that the parametrized node ID is not actually being ASCII sanitized.

Details

OS

Darwin 186590df9307.ant.amazon.com 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct 4 00:17:00 PDT 2017; root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64

Isolated test code

@pytest.mark.parametrize('plaintext_source, b64_plaintext_with_whitespace, read_bytes', (
    (b'\x00\x00\x00', b'AAAA', 3),
))
def test_base64io_decode_parametrized_null_bytes(plaintext_source, b64_plaintext_with_whitespace, read_bytes):
    with Base64IO(io.BytesIO(b64_plaintext_with_whitespace)) as decoder:
        test = decoder.read(read_bytes)

    assert test == plaintext_source[:read_bytes]

Test/pip list with

pytest 3.2.5

186590df9307:aws-encryption-sdk-cli bullocm$ tox -re py36 test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes -- -v
GLOB sdist-make: /Users/bullocm/git/aws-encryption-sdk-cli/setup.py
py36 recreate: /Users/bullocm/git/aws-encryption-sdk-cli/.tox/py36
py36 installdeps: mock, pytest==3.2.5, pytest-catchlog, pytest-cov, pytest-mock, coverage
py36 inst: /Users/bullocm/git/aws-encryption-sdk-cli/.tox/dist/aws-encryption-sdk-cli-1.1.2.zip
py36 installed: asn1crypto==0.23.0,attrs==17.3.0,aws-encryption-sdk==1.3.2,aws-encryption-sdk-cli==1.1.2,boto3==1.4.8,botocore==1.8.2,cffi==1.11.2,coverage==4.4.2,cryptography==2.1.3,docutils==0.14,idna==2.6,jmespath==0.9.3,mock==2.0.0,pbr==3.1.1,py==1.5.2,pycparser==2.18,pytest==3.2.5,pytest-catchlog==1.2.2,pytest-cov==2.5.1,pytest-mock==1.6.3,python-dateutil==2.6.1,s3transfer==0.1.11,six==1.11.0,typing==3.6.2,wrapt==1.10.11
py36 runtests: PYTHONHASHSEED='309851949'
py36 runtests: commands[0] | coverage run -m pytest --cov aws_encryption_sdk_cli test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes -v
============================================================================================ test session starts =============================================================================================
platform darwin -- Python 3.6.2, pytest-3.2.5, py-1.5.2, pluggy-0.4.0 -- /Users/bullocm/git/aws-encryption-sdk-cli/.tox/py36/bin/python3.6
cachedir: .cache
rootdir: /Users/bullocm/git/aws-encryption-sdk-cli, inifile:
plugins: mock-1.6.3, cov-2.5.1, catchlog-1.2.2
collected 1 item                                                                                                                                                                                              

test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes[\x00\x00\x00-AAAA-3] PASSED

---------- coverage: platform darwin, python 3.6.2-final-0 -----------
Name                                                                                          Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------------------------------------------------------------------------------
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/__init__.py                        118     89     56      0    17%   37-39, 54-59, 69-71, 84-89, 102-108, 125-147, 158-213, 232-246, 255-290
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/exceptions.py                        4      0      0      0   100%
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/__init__.py                 1      0      0      0   100%
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/arg_parsing.py            182    148     56      0    14%   35-37, 51-53, 64-72, 83-86, 93-107, 125-128, 137-140, 154-358, 370-382, 393-397, 408-411, 427-445, 458-475, 489-524, 535-563
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/encoding.py               119     55     42      8    46%   28-30, 67, 94-95, 98, 115-119, 131, 146, 163-180, 188-189, 201-218, 230, 233, 236, 248, 268, 283, 295-300, 305-308, 313, 66->67, 93->94, 97->98, 229->230, 232->233, 235->236, 238->244, 247->248
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/identifiers.py             22      2      2      0    92%   18-20
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/io_handling.py            158    117     44      0    21%   34-36, 48-50, 59-61, 69-71, 80-91, 104-106, 121-127, 138-139, 180-187, 201-238, 251-269, 278-304, 314-348, 359-374
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/logging_utils.py           83     57     10      0    28%   21-23, 48-50, 60-67, 76-81, 91-99, 108-114, 123-128, 137-138, 150-151, 161, 173-181, 191-208
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/master_key_parsing.py      74     51     28      0    23%   31-33, 43-63, 73-75, 87-111, 133-139, 153-155, 166-177, 188-196
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/metadata.py                87     54     32      0    29%   29-31, 60, 71-91, 96, 101-105, 110-111, 116-124, 129, 137-141, 152, 165-186, 200-205
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/mypy_types.py              20      3      2      1    82%   46-49, 43->46
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/key_providers.py                    31     31      4      0     0%   13-69
-----------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                           899    607    276      9    26%


========================================================================================== 1 passed in 0.60 seconds ==========================================================================================
__________________________________________________________________________________________________ summary ___________________________________________________________________________________________________
  py36: commands succeeded
  congratulations :)
186590df9307:aws-encryption-sdk-cli bullocm$ source .tox/py36/bin/activate
(py36) 186590df9307:aws-encryption-sdk-cli bullocm$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
asn1crypto (0.23.0)
attrs (17.3.0)
aws-encryption-sdk (1.3.2)
aws-encryption-sdk-cli (1.1.2)
boto3 (1.4.8)
botocore (1.8.2)
cffi (1.11.2)
coverage (4.4.2)
cryptography (2.1.3)
docutils (0.14)
idna (2.6)
jmespath (0.9.3)
mock (2.0.0)
pbr (3.1.1)
pip (9.0.1)
py (1.5.2)
pycparser (2.18)
pytest (3.2.5)
pytest-catchlog (1.2.2)
pytest-cov (2.5.1)
pytest-mock (1.6.3)
python-dateutil (2.6.1)
s3transfer (0.1.11)
setuptools (38.2.3)
six (1.11.0)
typing (3.6.2)
wheel (0.30.0)
wrapt (1.10.11)

pytest 3.3.0

186590df9307:aws-encryption-sdk-cli bullocm$ tox -re py36 test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes -- -v
GLOB sdist-make: /Users/bullocm/git/aws-encryption-sdk-cli/setup.py
py36 create: /Users/bullocm/git/aws-encryption-sdk-cli/.tox/py36
py36 installdeps: mock, pytest==3.3.0, pytest-cov, pytest-mock, coverage
py36 inst: /Users/bullocm/git/aws-encryption-sdk-cli/.tox/dist/aws-encryption-sdk-cli-1.1.2.zip
py36 installed: asn1crypto==0.23.0,attrs==17.3.0,aws-encryption-sdk==1.3.2,aws-encryption-sdk-cli==1.1.2,boto3==1.4.8,botocore==1.8.2,cffi==1.11.2,coverage==4.4.2,cryptography==2.1.3,docutils==0.14,idna==2.6,jmespath==0.9.3,mock==2.0.0,pbr==3.1.1,pluggy==0.6.0,py==1.5.2,pycparser==2.18,pytest==3.3.0,pytest-cov==2.5.1,pytest-mock==1.6.3,python-dateutil==2.6.1,s3transfer==0.1.11,six==1.11.0,typing==3.6.2,wrapt==1.10.11
py36 runtests: PYTHONHASHSEED='2217619473'
py36 runtests: commands[0] | coverage run -m pytest --cov aws_encryption_sdk_cli test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes -v
============================================================================================ test session starts =============================================================================================
platform darwin -- Python 3.6.2, pytest-3.3.0, py-1.5.2, pluggy-0.6.0 -- /Users/bullocm/git/aws-encryption-sdk-cli/.tox/py36/bin/python3.6
cachedir: .cache
rootdir: /Users/bullocm/git/aws-encryption-sdk-cli, inifile:
plugins: mock-1.6.3, cov-2.5.1
collected 1 item                                                                                                                                                                                             

test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes[-AAAA-3] ERROR                                                                                                             [100%]
test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes[-AAAA-3] ERROR                                                                                                             [200%]

---------- coverage: platform darwin, python 3.6.2-final-0 -----------
Name                                                                                          Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------------------------------------------------------------------------------
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/__init__.py                        118     89     56      0    17%   37-39, 54-59, 69-71, 84-89, 102-108, 125-147, 158-213, 232-246, 255-290
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/exceptions.py                        4      0      0      0   100%
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/__init__.py                 1      0      0      0   100%
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/arg_parsing.py            182    148     56      0    14%   35-37, 51-53, 64-72, 83-86, 93-107, 125-128, 137-140, 154-358, 370-382, 393-397, 408-411, 427-445, 458-475, 489-524, 535-563
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/encoding.py               119     87     42      0    20%   28-30, 65-72, 77, 82, 93-98, 113-121, 131, 141, 146, 163-180, 188-189, 201-218, 229-261, 268, 283, 295-300, 305-308, 313
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/identifiers.py             22      2      2      0    92%   18-20
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/io_handling.py            158    117     44      0    21%   34-36, 48-50, 59-61, 69-71, 80-91, 104-106, 121-127, 138-139, 180-187, 201-238, 251-269, 278-304, 314-348, 359-374
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/logging_utils.py           83     57     10      0    28%   21-23, 48-50, 60-67, 76-81, 91-99, 108-114, 123-128, 137-138, 150-151, 161, 173-181, 191-208
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/master_key_parsing.py      74     51     28      0    23%   31-33, 43-63, 73-75, 87-111, 133-139, 153-155, 166-177, 188-196
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/metadata.py                87     54     32      0    29%   29-31, 60, 71-91, 96, 101-105, 110-111, 116-124, 129, 137-141, 152, 165-186, 200-205
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/internal/mypy_types.py              20      3      2      1    82%   46-49, 43->46
.tox/py36/lib/python3.6/site-packages/aws_encryption_sdk_cli/key_providers.py                    31     31      4      0     0%   13-69
-----------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                           899    639    276      1    23%


=================================================================================================== ERRORS ===================================================================================================
_________________________________________________________________ ERROR at setup of test_base64io_decode_parametrized_null_bytes[-AAAA-3] _________________________________________________________________

self = environ({'PATH': '/Users/bullocm/git/aws-encryption-sdk-cli/.tox/py36/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin...ncryption_sdk_cli', 'COV_CORE_CONFIG': '', 'COV_CORE_DATAFILE': '/Users/bullocm/git/aws-encryption-sdk-cli/.coverage'})
key = b'PYTEST_CURRENT_TEST', value = b'test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes[\x00\x00\x00-AAAA-3] (setup)'

    def __setitem__(self, key, value):
        key = self.encodekey(key)
        value = self.encodevalue(value)
>       self.putenv(key, value)
E       ValueError: embedded null byte

.tox/py36/lib/python3.6/os.py:675: ValueError
_______________________________________________________________ ERROR at teardown of test_base64io_decode_parametrized_null_bytes[-AAAA-3] ________________________________________________________________

self = environ({'PATH': '/Users/bullocm/git/aws-encryption-sdk-cli/.tox/py36/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin...ncryption_sdk_cli', 'COV_CORE_CONFIG': '', 'COV_CORE_DATAFILE': '/Users/bullocm/git/aws-encryption-sdk-cli/.coverage'})
key = b'PYTEST_CURRENT_TEST', value = b'test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes[\x00\x00\x00-AAAA-3] (teardown)'

    def __setitem__(self, key, value):
        key = self.encodekey(key)
        value = self.encodevalue(value)
>       self.putenv(key, value)
E       ValueError: embedded null byte

.tox/py36/lib/python3.6/os.py:675: ValueError
========================================================================================== 2 error in 0.71 seconds ===========================================================================================
ERROR: InvocationError: '/Users/bullocm/git/aws-encryption-sdk-cli/.tox/py36/bin/coverage run -m pytest --cov aws_encryption_sdk_cli test/unit/test_encoding.py::test_base64io_decode_parametrized_null_bytes -v'
__________________________________________________________________________________________________ summary ___________________________________________________________________________________________________
ERROR:   py36: commands failed
186590df9307:aws-encryption-sdk-cli bullocm$ source .tox/py36/bin/activate
(py36) 186590df9307:aws-encryption-sdk-cli bullocm$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
asn1crypto (0.23.0)
attrs (17.3.0)
aws-encryption-sdk (1.3.2)
aws-encryption-sdk-cli (1.1.2)
boto3 (1.4.8)
botocore (1.8.2)
cffi (1.11.2)
coverage (4.4.2)
cryptography (2.1.3)
docutils (0.14)
idna (2.6)
jmespath (0.9.3)
mock (2.0.0)
pbr (3.1.1)
pip (9.0.1)
pluggy (0.6.0)
py (1.5.2)
pycparser (2.18)
pytest (3.3.0)
pytest-cov (2.5.1)
pytest-mock (1.6.3)
python-dateutil (2.6.1)
s3transfer (0.1.11)
setuptools (38.2.3)
six (1.11.0)
typing (3.6.2)
wheel (0.30.0)
wrapt (1.10.11)
@nicoddemus nicoddemus added status: critical grave problem or usability issue that affects lots of users topic: reporting related to terminal output and user-facing messages and errors type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously labels Nov 28, 2017
@nicoddemus
Copy link
Member

Thanks @mattsb42-aws for reporting this issue.

tiran added a commit to tiran/freeipa that referenced this issue Nov 28, 2017
pytest is setting an env var PYTEST_CURRENT_TEST to the test name + test
parameters. If parameters happen to contain NULL bytes, the putenv()
call fails with "ValueError: embedded null byte". The workaround uses
repr() of test parameters as parameter id.

See pytest-dev/pytest#2957
Signed-off-by: Christian Heimes <cheimes@redhat.com>
tiran added a commit to tiran/freeipa that referenced this issue Nov 28, 2017
pytest is setting an env var PYTEST_CURRENT_TEST to the test name + test
parameters. If parameters happen to contain NULL bytes, the putenv()
call fails with "ValueError: embedded null byte". The workaround uses
repr() of test parameters as parameter id.

See pytest-dev/pytest#2957
Signed-off-by: Christian Heimes <cheimes@redhat.com>
tiran added a commit to tiran/freeipa that referenced this issue Nov 28, 2017
pytest is setting an env var PYTEST_CURRENT_TEST to the test name + test
parameters. If parameters happen to contain NULL bytes, the putenv()
call fails with "ValueError: embedded null byte". The workaround uses
repr() of test parameters as parameter id.

See pytest-dev/pytest#2957
Signed-off-by: Christian Heimes <cheimes@redhat.com>
tiran added a commit to tiran/freeipa that referenced this issue Nov 28, 2017
pytest is setting an env var PYTEST_CURRENT_TEST to the test name + test
parameters. If parameters happen to contain NULL bytes, the putenv()
call fails with "ValueError: embedded null byte". The workaround uses
repr() of test parameters as parameter id.

See pytest-dev/pytest#2957
Signed-off-by: Christian Heimes <cheimes@redhat.com>
tiran added a commit to tiran/freeipa that referenced this issue Nov 28, 2017
pytest is setting an env var PYTEST_CURRENT_TEST to the test name + test
parameters. If parameters happen to contain NULL bytes, the putenv()
call fails with "ValueError: embedded null byte". The workaround uses
repr() of test parameters as parameter id.

See pytest-dev/pytest#2957
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
nicoddemus added a commit to nicoddemus/pytest that referenced this issue Nov 28, 2017
@nicoddemus
Copy link
Member

Digging deeper, it appears that the immediate reason for this error is this commit that indicates that ascii escaping is no longer necessary because it is sanitized during the parametrization process.

Strangely, that commit is available since 3.2.1 as shown by the tags in the commit page.

We already have a test in place which uses null bytes during parametrization and ensures it does not break:

def test_parametrized_with_null_bytes(self, testdir):
"""Test parametrization with values that contain null bytes and unicode characters (#2644)"""
p = testdir.makepyfile(u"""
# encoding: UTF-8
import pytest
@pytest.mark.parametrize("data", ["\\x00", u'ação'])
def test_foo(data):
assert data
""")
res = testdir.runpytest(p)
res.assert_outcomes(passed=2)

And this test passes on all platforms and Python versions we test it on.

I made a quick test in two local Python 3.6 installations installations I had around:

3.6.0:

Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['FOO'] = 'foo\x00'
>>>

3.6.3:

Python 3.6.3 | packaged by conda-forge | (default, Nov  4 2017, 10:10:42) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ['FOO'] = 'foo\x00'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Miniconda3\lib\os.py", line 675, in __setitem__
    self.putenv(key, value)
ValueError: embedded null character
>>>

I had 3.6.0 mostly by accident in an old virtual environment. I took a look the changelog for Python 3.6 but did not find anything to explain this difference in behavior. After updating my local virtual environment I also get the embedded null character error when running the original test in acceptance_test.py but only if I add a null value as bytes:

@pytest.mark.parametrize("data", [b"\\x00", "\\x00", u'ação'])
def test_foo(data):

Anyway, it seems dangerous to allow null bytes so I opened #2969 escaping null bytes in all versions. 😅

@mattsb42-aws
Copy link
Author

Weird; I didn't think to test with earlier versions of 3.6; both of the tests I ran were with 3.6.2. Maybe some combination of changes between Python 3.6.0-3.6.2 and pytest 3.2.5-3.3.0?

Either way, I agree with your conclusion. Always squashing null bytes is probably the safest option.

@nicoddemus
Copy link
Member

I didn't think to test with earlier versions of 3.6;

TBH neither did I, it happened by accident because I had a local environment with 3.6.0 and started playing with it by accident, hehehe.

abbra pushed a commit to abbra/freeipa that referenced this issue Nov 29, 2017
pytest is setting an env var PYTEST_CURRENT_TEST to the test name + test
parameters. If parameters happen to contain NULL bytes, the putenv()
call fails with "ValueError: embedded null byte". The workaround uses
repr() of test parameters as parameter id.

See pytest-dev/pytest#2957
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
@ThomasWaldmann
Copy link

Also seeing that for borgbackup tests. Thanks for fixing it, looking forward to 3.3.1. :)

@ThomasWaldmann
Copy link

ThomasWaldmann commented Dec 2, 2017

Is there a "soon" ETA for 3.3.1 or do we need to add pytest!=3.3.0 to requirements?

https://travis-ci.org/borgbackup/borg/builds/310283134

@nicoddemus
Copy link
Member

nicoddemus commented Dec 2, 2017

I plan to have 3.3.1 out by the end of the next week at most (possibly earlier), but by all means add pytest!=3.3.0 to your requirements meanwhile.

ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 2, 2017
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 2, 2017
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 2, 2017
ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Dec 2, 2017
asottile added a commit to zackhsi/all-repos that referenced this issue Dec 2, 2017
patkan added a commit to python-escpos/python-escpos that referenced this issue Dec 3, 2017
mingwandroid added a commit to AnacondaRecipes/pytest-feedstock that referenced this issue Dec 4, 2017
This reverts commit 9faa2fb.

Conflicts:
	recipe/meta.yaml

This needed to be reverted because we cannot build cryptography
with 3.3.0 due to pytest-dev/pytest#2957

.. we can remove this commit when 3.3.1 comes out.
@nicoddemus
Copy link
Member

pytest 3.3.1 released which fixes this issue

asottile added a commit to asottile/all-repos that referenced this issue Dec 6, 2017
asottile added a commit to asottile/all-repos that referenced this issue Dec 6, 2017
stanislavlevin pushed a commit to stanislavlevin/freeipa that referenced this issue Jun 3, 2019
pytest is setting an env var PYTEST_CURRENT_TEST to the test name + test
parameters. If parameters happen to contain NULL bytes, the putenv()
call fails with "ValueError: embedded null byte". The workaround uses
repr() of test parameters as parameter id.

See pytest-dev/pytest#2957
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: critical grave problem or usability issue that affects lots of users topic: reporting related to terminal output and user-facing messages and errors type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously
Projects
None yet
Development

No branches or pull requests

3 participants