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

Henrik Levkowetz <henrik@levkowetz.com> Mon, 23 December 2019 15:06 UTC

Return-Path: <henrik@levkowetz.com>
X-Original-To: xml2rfc@ietfa.amsl.com
Delivered-To: xml2rfc@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D623F1200C3 for <xml2rfc@ietfa.amsl.com>; Mon, 23 Dec 2019 07:06:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.9
X-Spam-Level:
X-Spam-Status: No, score=-6.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ekwDaG7YbGzR for <xml2rfc@ietfa.amsl.com>; Mon, 23 Dec 2019 07:06:14 -0800 (PST)
Received: from zinfandel.tools.ietf.org (zinfandel.tools.ietf.org [64.170.98.42]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 132BD120026 for <xml2rfc@ietf.org>; Mon, 23 Dec 2019 07:06:14 -0800 (PST)
Received: from h-202-242.a357.priv.bahnhof.se ([158.174.202.242]:53032 helo=tannat.localdomain) by zinfandel.tools.ietf.org with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <henrik@levkowetz.com>) id 1ijPHg-0004eR-V0; Mon, 23 Dec 2019 07:06:13 -0800
To: Antonin Décimo <antonin.decimo@gmail.com>, xml2rfc@ietf.org
References: <CAC=54BK6hxidy+dDLHM9o0A4kt=fZaikQT9et4+jQ0MUdoAbHw@mail.gmail.com>
From: Henrik Levkowetz <henrik@levkowetz.com>
Message-ID: <cad3348f-6f68-24e2-5fdd-b2587ad4487c@levkowetz.com>
Date: Mon, 23 Dec 2019 16:05:56 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CAC=54BK6hxidy+dDLHM9o0A4kt=fZaikQT9et4+jQ0MUdoAbHw@mail.gmail.com>
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="Ie8vQv6ReAxES76TbXCRdXnFUdTBMHspr"
X-SA-Exim-Connect-IP: 158.174.202.242
X-SA-Exim-Rcpt-To: xml2rfc@ietf.org, antonin.decimo@gmail.com
X-SA-Exim-Mail-From: henrik@levkowetz.com
X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000)
X-SA-Exim-Scanned: Yes (on zinfandel.tools.ietf.org)
X-Clacks-Overhead: GNU Terry Pratchett
Archived-At: <https://mailarchive.ietf.org/arch/msg/xml2rfc/5oxqNA567bqCAPXASfIyBxB_hQI>
Subject: Re: [xml2rfc] [Bug]: AttributeError: module 'cgi' has no attribute 'escape'
X-BeenThere: xml2rfc@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <xml2rfc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/xml2rfc/>
List-Post: <mailto:xml2rfc@ietf.org>
List-Help: <mailto:xml2rfc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 23 Dec 2019 15:06:16 -0000

Hi Antonin,

On 2019-12-23 12:00, Antonin Décimo wrote:
> 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

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.

> It would be nice to have a link to the bug tracker on the homepage, or
> 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