Skip to content

Fixes for Python 3.14 and fixes for deprecations #1539

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 9 commits into from
Jun 19, 2025

Conversation

facelessuser
Copy link
Collaborator

  • Fix codecs deprecation
  • Fix issue with unclosed <![
  • Fix issue with unclosed HTML tag <foo

Fixes #1537

- Fix codecs deprecation
- Fix issue with unclosed `<![`
- Fix issue with unclosed HTML tag `<foo`

Fixes Python-Markdown#1537
@facelessuser
Copy link
Collaborator Author

Something in this project's MkDocs setup is choking on an inline code `<![`. Probably a plugin, as I can't reproduce it in any of my external projects that use Mkdocs. This is not a concern for me right now. All the changes this PR makes are currently backwards compatible and pass in Python 3.14b03 as well (tested locally). Two failing tests in Python 3.14 remain. One in test_html_blocks and one in test_md_in_html. Both of these tests fail when parsing <! not a comment ... more content until end of the file.. Python 3.14 now consumes text as a comment until it is closed or reaches the end of the file.

  1. We accept this change and alter tests.
  2. We can try and track down how to override this behavior.

@facelessuser
Copy link
Collaborator Author

@waylan This is ready for input. I realize these are hacky fixes, but this identifies what the issues are and "possible" ways to fix them. I am open to better approaches if anyone has better approaches, but if we want to have backwards compatibility, this is at least an approach that could be done.

Copy link
Member

@waylan waylan left a comment

Choose a reason for hiding this comment

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

Overall, I think this looks good. I understand your concern about the general hackiness of the changes, but much of the code for the HTML parser is so I'm not too worried about it.

@waylan
Copy link
Member

waylan commented Jun 19, 2025

I'm thinking perhaps we should add a Python 3.14 set of tests to CI. I realize the backport will eventually make its way to all of the Python versions we support, but it would be good to have active tests passing before we merge. We don't need to officially list 3.14 as supported in the project metadata yet (unless it refuses to install), but just the tests.

@facelessuser
Copy link
Collaborator Author

'm thinking perhaps we should add a Python 3.14 set of tests to CI. I realize the backport will eventually make its way to all of the Python versions we support, but it would be good to have active tests passing before we merge. We don't need to officially list 3.14 as supported in the project metadata yet (unless it refuses to install), but just the tests.

Yep, I was planning to do this, just hadn't done it yet. I'll add it to this review.

@facelessuser
Copy link
Collaborator Author

It looks like CI is pulling Python 3.14b3 and it is passing, so this verifies the claim that 3.14 has parity with older versions.

@waylan
Copy link
Member

waylan commented Jun 19, 2025

This is still in draft status. Were you waiting for anything else before changing the status so it can be merged?

@facelessuser facelessuser marked this pull request as ready for review June 19, 2025 15:23
@facelessuser
Copy link
Collaborator Author

facelessuser commented Jun 19, 2025

Nope, just wanted input first on whether this was our desired direction. I've moved it to normal review status now.

@waylan waylan merged commit 9980cb5 into Python-Markdown:master Jun 19, 2025
16 checks passed
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.

Test failures with Python 3.14.0b3
2 participants