8000 bpo-34480: fix bug where match variable is used prior to being defined by jkamdjou · Pull Request #17643 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-34480: fix bug where match variable is used prior to being defined #17643

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

Conversation

jkamdjou
Copy link
@jkamdjou jkamdjou commented Dec 17, 2019

@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 this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@jkamdjou

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@tirkarthi
Copy link
Member

The issue is reported under https://bugs.python.org/issue34480. You might want to prepend the issue number as per the required format to link this PR. The issue discusses the usage of self.error to raise an exception. This needs a test case. Something like creating a custom subclass of HTMLParser and feed it with "<![nonexistent>" that triggers this and the fix needs to be approved by core dev in the linked issue discussion. Thanks.

@csabella
Copy link
Contributor

@jkamdjou, thank you for your contribution. Please address @tirkarthi's comments from 2 weeks ago. If you're unable to update this PR, then we will need to close it. Thank you!

@jkamdjou jkamdjou changed the title fix bug where match variable is used prior to being defined bpo-34480: fix bug where match variable is used prior to being defined Jan 4, 2020
@jkamdjou
Copy link
Author
jkamdjou commented Jan 4, 2020

Title updated with issue # (didn't see the issue, my apologies). Responded to the issue, awaiting core dev feedback. Thanks!

@csabella
Copy link
Contributor

@jkamdjou, thank you for updating the PR. Based on the discussion on the pull request, please add tests here. Ezio said that both pull requests (this one and PR 8562) are needed, so one doesn't supercede the other. Thank you!

@@ -156,6 +156,7 @@ def parse_marked_section(self, i, report=1):
# look for MS Office ]> ending
match= _msmarkedsectionclose.search(rawdata, i+3)
else:
match = None
Copy link
Member

Choose a reason for hiding this comment

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

I've changed this branch to raise an AssertionError in #8562. Depending on @ezio-melotti's feedback, I can also change it to return -1. In both cases, this PR may not be needed so I'd suggest waiting for #8562 to be resolved first.

I think it would be nice to have a test case that hits to this branch.

Copy link
Member

Choose a reason for hiding this comment

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

8562 has been merged, so I think this can be closed.

@jkamdjou
Copy link
Author

Closing as it looks like this is no longer needed after merging #8562. thanks @berkerpeksag @iritkatriel

@jkamdjou jkamdjou closed this Nov 22, 2021
@mareksuscak
Copy link

Closing as it looks like this is no longer needed after merging #8562. thanks @berkerpeksag @iritkatriel

It doesn't seem to be fixed for me running Python 3.8.12 and beautifulsoup==4.10.0. Can you please clarify if the patch has only been applied on Python 3.9.0+?

@iritkatriel
Copy link
Member

3.8 is only getting security fixes now.

@mareksuscak
Copy link
mareksuscak commented Mar 27, 2022

@iritkatriel got it, thanks for pointing that out. Just tested on Python 3.9.12 and the same error occurs, though. The changes in this PR suggest the issue was fixed in Python 3.9 but it's only fixed in Python 3.10 according to the changelog. We're unfortunately unable to upgrade since Apache Beam has only recently introduced support for Python 3.9. Any chance this bugfix could be backported to 3.9?

@iritkatriel
Copy link
Member

Please comment on https://bugs.python.org/issue34480 to explain the current state of the issue. It will be a up to the 3.9 release manager (@ambv) to decide how to proceed.

ambv added a commit that referenced this pull request May 16, 2022
…defined (GH-17643) (GH-32256)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
…defined (pythonGH-17643) (pythonGH-32256)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
0