Menu

#463 Bug in nodes.py warnings

closed-fixed
nobody
None
9
2023-05-10
2022-12-08
jp
No

Hi!

I think https://sourceforge.net/p/docutils/code/8949/
introduced a bug in https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/nodes.py#l1071
Not sure if you can split the string with a comma there.

It breaks a lot of code.
The error is:

Exception occurred:
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/docutils/nodes.py", line 1069, in set_class
    warnings.warn('docutils.nodes.Element.set_class() is deprecated; '
TypeError: argument for warn() given by name ('stacklevel') and position (3)

Discussion

  • Günter Milde

    Günter Milde - 2022-12-17
    • status: open --> open-fixed
     
  • Günter Milde

    Günter Milde - 2022-12-17

    Fixed in [r9310]. Thank you for the report and sorry for the breaks.

    As a future-proof workaround, you may consider heading the tip in the DeprecationMessage
    and set the class name directly instead of via the deprecated node.set_class() method.

     

    Related

    Commit: [r9310]

  • jp

    jp - 2022-12-19

    Yes, no worries. Thank you! We also implemented your suggestion for futureproofness.

     
  • Günter Milde

    Günter Milde - 2023-05-10
    • status: open-fixed --> closed-fixed
     
  • Günter Milde

    Günter Milde - 2023-05-10

    Fixed in Docutils 0.20
    Thank you for reporting.

     

Log in to post a comment.