Skip to content

bpo-30629: Fix call lower() twice #2099

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

Merged
merged 1 commit into from
Jun 17, 2017
Merged

Conversation

narusemotoki
Copy link
Contributor

@narusemotoki narusemotoki commented Jun 11, 2017

https://bugs.python.org/issue30629
https://github.com/python/cpython/blob/master/Lib/html/parser.py#L415

        elem = match.group(1).lower() # script or style
        if self.cdata_elem is not None:
            if elem != self.cdata_elem:
                self.handle_data(rawdata[i:gtpos])
                return gtpos

        self.handle_endtag(elem.lower())

elem is lowercase string because lower() is called at the first line.
So the last line of calling lower() is unnecessary.

https://bugs.python.org/issue30629
https://github.com/python/cpython/blob/master/Lib/html/parser.py#L415

```
        elem = match.group(1).lower() # script or style
        if self.cdata_elem is not None:
            if elem != self.cdata_elem:
                self.handle_data(rawdata[i:gtpos])
                return gtpos

        self.handle_endtag(elem.lower())
```

elem is lowercase string because lower() is called at the first line.
So the last line of calling lower() is unnecessary.
@mention-bot
Copy link

@narusemotoki, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ezio-melotti, @freddrake and @bitdancer to be potential reviewers.

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@narusemotoki
Copy link
Contributor Author

@rhettinger @the-knights-who-say-ni
Hello
Now, I can see "Contributor Form Received Yes" on my profile page. How can I run CLA check again or Could I ask you to do it?

@terryjreedy terryjreedy merged commit 3358d58 into python:master Jun 17, 2017
@narusemotoki narusemotoki deleted the bpo-30629 branch June 20, 2017 04:13
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.

6 participants