Skip to content

htmldocck: don't let HTMLParser convert charrefs #57371

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

Closed
wants to merge 1 commit into from
Closed

htmldocck: don't let HTMLParser convert charrefs #57371

wants to merge 1 commit into from

Conversation

hdhoang
Copy link
Contributor

@hdhoang hdhoang commented Jan 6, 2019

With python 3.5, the default value for convert_charrefs became True. This broke nbsp conversion for @matches XPATH PATTERN tests.

My distro has python 3.7 as python, so I came across this failure:

12: @matches check failed
        `XPATH PATTERN` did not match
        // @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' '🔬 This is a nightly-only experimental API. \(test #32374\)$'

Putting a breakpoint on this method:

    def handle_entityref(self, name):
        self.__builder.data(entitydefs[name])

shows that it was not called. I suspect this is due to the change in behaviour between python3.4 and 3.5 documented in the constructor and the method: https://docs.python.org/3/library/html.parser.html#html.parser.HTMLParser.handle_entityref

With python 3.5, the default value for `convert_charrefs` became True. This broke nbsp conversion for `@matches` XPATH PATTERN tests.
@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 6, 2019
@euclio
Copy link
Contributor

euclio commented Jan 6, 2019

I posted a more general fix for this in #57358.

@hdhoang
Copy link
Contributor Author

hdhoang commented Jan 6, 2019

thank you for updating!

@hdhoang hdhoang closed this Jan 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants