-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[5.2.x] Fixed #36535 -- Ensured compatibility with docutils < 0.22 and also 0.22+. #19690
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
Conversation
d65fc57
to
d6fa9b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
parts = docutils.core.publish_parts( | ||
source % text, | ||
source_path=thing_being_parsed, | ||
destination_path=None, | ||
writer="html", | ||
writer=writer_instance, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd consider adding release notes (5.2.5.txt
):
* Added compatibility for ``docutils`` 0.22 (:ticket:`36535`)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that we'd need to add the release note on main as well 👍
Unsure if it's easier to target main, backport, then do the drop of docutils < 0.22 support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that we'd need to add the release note on main as well 👍
Not sure if we need it 🤔, adding this to 5.2.5 means that Django 5.2.5+ is compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felixxm but if we add it only to 5.2.5 there would be a discrepancy between main
and stable/5.2.x
... I haven't seen that before! (other than the version bumps for releasing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I mean that the release note should also exist on main
As discussed with Sarah, we'll be closing this in favor of #19693. |
Regression in 5aefd00.
Trac ticket number
ticket-36535
Branch description
This change ensures compatibility with both older and newer versions of Docutils, including recent version 0.22.
Docutils 0.22 includes this change, which allows the
writer
parameter to be either a string or an instance. However, older versions only accept the writer name as a string passed via thewriter_name
argument (which was removed in 0.22). The good news is that older version already accepted anwriter
param which should be given a writer instance.To support versions from 0.19 through 0.22 and beyond, this change updates the logic to create a writer instance explicitly, avoiding version-specific behavior.