-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Avoid null-characters in junitxml output #37
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
Comments
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt): it might make to escape all nonprintable bytes to entities or escapes, |
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): I guess Ronny's more general solution would make sense - maybe he can contribute a patch? But i am also fine with Flori's patch for now - feel free to apply it and add a CHANGELOG entry (fix issue37 etc.). I plan to release 2.0.3 these days. best, holger |
Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub): I'm actually midway experimenting with Ronny's suggestion, so far I know the official XML legal characters are defined as |
Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub): Right, my conclusion from some experimenting seems to be that all the above mentioned characters should not be allowed. First question however is what to do with them? Should they just be stripped or should they be replaced? If replaced, what with: python-esque "\xNN" or XML-spec like "#xNN"? I think I'd prefer them to be escaped to #xNN. Next question is where to do this. py.xml.escape would seem like an obvious choice though it would change the semantics of function significantly (it no longer just escapes your data, it actively modifies it). So at most py.xml.escape should be made to complain for invalid chars (but even that might be out of it's scope). So my preference goes to doing this in the junitxml plugin, like my first simplistic patch did. This also has the benefit of not having to deal with XML 1.0 and 1.1 since that always outputs 1.0 (1.1 has a slightly different character range). Does that sound reasonable? |
Ensure we can pass the -i flag to pyinstall, even if we have a configuration file.
…package_support-windows virtualenv/install_package: Add support for windows
Originally reported by: Floris Bruynooghe (BitBucket: flub, GitHub: flub)
It appears that at least Jenkins' XML parser does not like null-characters to appear in the JUnit XML file. To avoid this I've created a patch which simply removes any null characters from the XML file written by junitxml.
https://bitbucket.org/flub/pytest-queue/src/tip/junitxml_nullchar
If there is a consensus that this is indeed a bug in pytest and the correct way to fix I can commit this.
The text was updated successfully, but these errors were encountered: