Menu

#437 Text.rawsource incorrectly removed (or falsely advertised) in 0.18

closed-fixed
nobody
None
5
2022-07-06
2021-11-29
No

The attribute Text.rawsource has been removed already in version 0.18, but the release notes show this as a "future change". What is the correct stance?

This is currently affecting pospell, which has pinned its dependency on docutils to docutils>=0.11,<0.18.

Discussion

  • Günter Milde

    Günter Milde - 2021-12-01

    I am sorry for the confusion and troubles.
    Docutils 0.18 removed the attribute nodes.Text.rawsource but not (yet) the "rawsource" argument in nodes.Text's __init__(self, data, rawsource=None).
    [r8911] fixes the release notes.

    The undocumented "rawsource" attribute of the classes defined in nodes.py is just a developer aid, not to be used in production.

    Backwards-compatibility for <0.16 is possible with

    try:
           self.output.append(node.rawsource)
     except AttributeError
          self.output.append(docutils.nodes.unescape(node, restore_backslashes=True))
    

    Thank you for reporting.

     

    Related

    Commit: [r8911]

  • Rodrigo Tobar

    Rodrigo Tobar - 2021-12-02

    Thanks for fixing the release notes and for the clarification.

    At the end we ended up raising the lowest required version to 0.16, so went for the unescape method.

     
  • Günter Milde

    Günter Milde - 2021-12-03
    • status: open --> open-fixed
     
  • Günter Milde

    Günter Milde - 2022-07-06
    • status: open-fixed --> closed-fixed
     
  • Günter Milde

    Günter Milde - 2022-07-06

    Fixed in release 0.19 (2022-07-05).

    The plan is now to

    Remove the "rawsource" argument from nodes.Text.init()
    (deprecated and ignored since Docutils 0.18) in Docutils 2.0.

    Thank you for the report.

     

Log in to post a comment.

MongoDB Logo MongoDB