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

Always escape null bytes when setting PYTEST_CURRENT_TEST #2969

Merged
merged 1 commit into from
Nov 29, 2017

Conversation

nicoddemus
Copy link
Member

@mattsb42-aws
Copy link

Looks good to me. Thanks for the quick turnaround!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 92.697% when pulling 89cf943 on nicoddemus:null-bytes-2957 into 4d2f05e on pytest-dev:master.

@The-Compiler
Copy link
Member

LGTM, thanks!

# python 2 doesn't like null bytes on environment variables (see #2644)
value = value.replace('\x00', '(null)')
# don't allow null bytes on environment variables (see #2644, #2957)
value = value.replace('\x00', '(null)')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i came to the conclusion thati this place is the completely wrong place to fix the issue

the real issue is that we allow bad test ids in the firs place - that is an full stop no go thing to begin with

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we consider that null bytes make part of a "bad test ids" (which I think is reasonable) I agree this is not the bast place to put it.

It is of course simple enough to refactor this later without much fuss. Would mind opening an issue @RonnyPfannschmidt?

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 this pull request may close these issues.

5 participants