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

junitxml doesnt escape everything #126

Closed
pytestbot opened this issue Feb 22, 2012 · 2 comments
Closed

junitxml doesnt escape everything #126

pytestbot opened this issue Feb 22, 2012 · 2 comments
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt)


as reported by anton on the ml


@pytestbot
Copy link
Contributor Author

Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub):


Original report:

Hello all,

I have the following issue with generated junitxml reports:

I'm writing test cases which use scapy functions. So I make asserts on
some packet objects. As I understand scapy uses esc characters for its
own objects representation, and I can see colorful output on the
console. But when test is failed, and its traceback went to xml, I
can't open generated xml due to the error "XML Parsing Error: not
well-formed" In my case the problem with esc charecter 033 (\x1b).
I resolved the issue by adding the following code to append_failure
method in LogXML class:
longrepr = str(report.longrepr).replace('\x1b', '\033')
fail.append(longrepr)

I think that it will be good if you add some cleanup functions to

avoid such situations.

Thank you,

-Anton

@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


junitxml: use a exclusive match on the legal ranges of xml for binary escaping, fixes issue 126

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
fkohlgrueber pushed a commit to fkohlgrueber/pytest that referenced this issue Oct 27, 2018
mgorny pushed a commit to mgorny/pytest that referenced this issue May 27, 2023
pytest-server-fixtures: fix random port logic in TestServerV2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant