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

fix(html): fix warning in python 3.13 #486

Closed
wants to merge 2 commits into from

Conversation

cscnk52
Copy link

@cscnk52 cscnk52 commented Dec 8, 2024

Closes #481

I am using Python 3.13.1, and this warning appeared. This PR was made to fix this warning

path\feedparser\html.py:152: DeprecationWarning: 'count' is passed as positional argument
  data = re.sub(r'<!((?!DOCTYPE|--|\[))', r'&lt;!\1', data, re.IGNORECASE)
.

@cscnk52 cscnk52 changed the title fix(html): fix warning in python 3.13.1 fix(html): fix warning in python 3.13 Dec 8, 2024
@kurtmckee
Copy link
Owner

This is addressed in the develop branch already, but hasn't been released yet.

This was fixed not by adding a count argument, but by making re.IGNORECASE a keyword argument. You can confirm this by checking the line in the original error message against the line currently in develop:

# Error message
data = re.sub(r"<!((?!DOCTYPE|--|\[))", r"&lt;!\1", data, re.IGNORECASE)

# Current line
data = re.sub(r"<!((?!DOCTYPE|--|\[))", r"&lt;!\1", data, flags=re.IGNORECASE)
#                                                         ^^^^^^

@kurtmckee kurtmckee closed this Dec 8, 2024
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.

Release for Python 3.13.0 compatibility
2 participants