Subject: [xml2rfc] [Bug]: AttributeError: module 'cgi' has no attribute 'escape'

From: Antonin Décimo <[email-masked]>
Date: Mon, 23 Dec 2019 12:00:31 +0100

Hello,

I got this crash when generating html. I'm using Arch Linux, I
installed xml2rfc from pip. Text and pdf generation works fine.

    $ xml2rfc --html draft-ietf-babel-hmac.xml
    Traceback (most recent call last):
      File "/home/antonin/.local/bin/xml2rfc", line 11, in <module>
        load_entry_point('xml2rfc==2.37.3', 'console_scripts', 'xml2rfc')()
      File "/home/antonin/.local/lib/python3.8/site-packages/xml2rfc/run.py",
line 504, in main
        htmlwriter.write(filename)
      File "/home/antonin/.local/lib/python3.8/site-packages/xml2rfc/writers/base.py",
line 1441, in write
        self.post_rendering()
      File "/home/antonin/.local/lib/python3.8/site-packages/xml2rfc/writers/legacy_html.py",
line 830, in post_rendering
        'docName':         cgi.escape(docName, quote=True),
    AttributeError: module 'cgi' has no attribute 'escape'

Thanks to some googling, a possible fix can be found here:
https://github.com/jupyter/nbconvert/commit/1aa14e34ce5b7aa13ef7480216daa3f9a824766f

It would be nice to have a link to the bug tracker on the homepage, or
to mention where bugs are to be reported.

Thanks,

-- Antonin Décimo

---

From: Henrik Levkowetz <[email-masked]>
Date: Mon, 23 Dec 2019 16:05:56 +0100

Hi Antonin,

> https://github.com/jupyter/nbconvert/commit/1aa14e34ce5b7aa13ef7480216daa3f9a824766f

Right.  I see you're using Python 3.8; the current test suite only runs
the tests on Py27, Py35, Py36, and Py37.  I expect to start running Py38
tests when I remove Py27 support in January.  I'll fix this at that time,
at the latest.

> to mention where bugs are to be reported.

Mmm.  Pypi points at the home page https://tools.ietf.org/tools/xml2rfc/trac/,
which has an entry 'New ticket' in the menubar.  But I'll add text on the page,
too.

Thanks for the alert!

Best regards,

	Henrik

---

From: Antonin Décimo <[email-masked]>
Date: Sun, 29 Dec 2019 12:22:04 +0100

Hi!

Sorry, your mail went into my spam box :(

> Pypi points at the home page
> https://tools.ietf.org/tools/xml2rfc/trac/, which has an entry 'New
> ticket' in the menubar.

Now that I see it, I don't understand how I missed that.
Thank you!

-- Antonin