Re: [xml2rfc-dev] New xml2rfc release: v2.37.1
Henrik Levkowetz <henrik@levkowetz.com> Fri, 13 December 2019 12:08 UTC
Return-Path: <henrik@levkowetz.com>
X-Original-To: xml2rfc-dev@ietfa.amsl.com
Delivered-To: xml2rfc-dev@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9A3C6120091 for <xml2rfc-dev@ietfa.amsl.com>; Fri, 13 Dec 2019 04:08:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.899
X-Spam-Level:
X-Spam-Status: No, score=-6.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 infdJgvb-2ur for <xml2rfc-dev@ietfa.amsl.com>; Fri, 13 Dec 2019 04:08:55 -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 2B456120020 for <xml2rfc-dev@ietf.org>; Fri, 13 Dec 2019 04:08:55 -0800 (PST)
Received: from [212.53.178.28] (port=55802 helo=[172.29.4.65]) 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 1ifjkK-0000Xw-M6; Fri, 13 Dec 2019 04:08:44 -0800
To: Martin Thomson <mt@lowentropy.net>
References: <E1ifORf-0005KZ-EH@durif.tools.ietf.org> <a0199b25-65ae-4aa2-aec2-c227516fa6d4@www.fastmail.com> <BA233573-400B-4B81-AEE3-CB639022C89D@levkowetz.com> <b8f3f454-3fc5-4489-b987-ebad7c542c67@www.fastmail.com>
Cc: xml2rfc-dev@ietf.org
From: Henrik Levkowetz <henrik@levkowetz.com>
Message-ID: <d8c55228-d6ce-5fd6-6cee-04fc65c3989e@levkowetz.com>
Date: Fri, 13 Dec 2019 13:08: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: <b8f3f454-3fc5-4489-b987-ebad7c542c67@www.fastmail.com>
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="Rv26UKQcxsXhewfp3mWKSrU9CJ9nJw5IX"
X-SA-Exim-Connect-IP: 212.53.178.28
X-SA-Exim-Rcpt-To: xml2rfc-dev@ietf.org, mt@lowentropy.net
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-dev/b9EAFDaPU8QodVH3nabk6FRyZ7I>
Subject: Re: [xml2rfc-dev] New xml2rfc release: v2.37.1
X-BeenThere: xml2rfc-dev@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Discussion about particulars of xml2rfc V3 design, development and code." <xml2rfc-dev.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/xml2rfc-dev>, <mailto:xml2rfc-dev-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/xml2rfc-dev/>
List-Post: <mailto:xml2rfc-dev@ietf.org>
List-Help: <mailto:xml2rfc-dev-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/xml2rfc-dev>, <mailto:xml2rfc-dev-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Dec 2019 12:08:57 -0000
Hi Martin, On 2019-12-13 02:11, Martin Thomson wrote: > Sorry, I foolishly left that out. > > The code crashes if you have unicode punctuation because of this: Huh. I guess this is a case of some Python 3 versions being stricter than 2.7. I did put in a test case for this, but in my rush to get the fix out, and having to rush for an airport, I didn't run the full tox suite. Which Python version did you use? Henrik > def downcode_punctuation(str): > while True: > match = re.search(punctuation_re, str) > if not match: > return str > str = re.sub(match.group(1), punctuation[match.group(1)], str) > > The last line expects a grouping, but the regular expression lacks that grouping. That's all. > > On Fri, Dec 13, 2019, at 12:01, Henrik Levkowetz wrote: >> Hi Martin, >> >> Please provide the reason for this change. >> >> Henrik >> >> > On 13 Dec 2019, at 01:25, Martin Thomson <mt@lowentropy.net> wrote: >> > >> > Hi Henrik, >> > >> > One small fix is required for downcode_punctuation(): >> > >> > diff --git a/xml2rfc/util/unicode.py b/xml2rfc/util/unicode.py >> > index 51ffbb5..6f59e6e 100644 >> > --- a/xml2rfc/util/unicode.py >> > +++ b/xml2rfc/util/unicode.py >> > @@ -218,21 +218,21 @@ unicode_quote_replacements = { >> > u'\u201e': '"', >> > u'\u2032': "'", >> > } >> > >> > punctuation = { >> > u'\u2026': '...', >> > } >> > punctuation.update(unicode_space_replacements) >> > punctuation.update(unicode_dash_replacements) >> > punctuation.update(unicode_quote_replacements) >> > -punctuation_re = re.compile(r'[%s]'%''.join(list(punctuation.keys()))) >> > +punctuation_re = re.compile(r'([%s])'%''.join(list(punctuation.keys()))) >> > >> > unicode_replacements = { >> > # Unicode code points corresponding to (x)html entities, also in >> > # rfc2629-xhtml.ent >> > u'\x09': ' ', >> > u'\xa0': ' ', >> > u'\xa1': '!', >> > u'\xa2': '[cents]', >> > u'\xa3': 'GBP', >> > u'\xa4': '[currency units]', >> > >> > Aside from that, this meets my immediate needs. >> > >> >> On Fri, Dec 13, 2019, at 00:23, Henrik Levkowetz wrote: >> >> >> >> Hi, >> >> >> >> This is an automatic notification about a new xml2rfc release, >> >> v2.37.1, generated when running the mkrelease script. >> >> >> >> Release notes: >> >> >> >> xml2rfc (2.37.1) ietf; urgency=medium >> >> >> >> * Fixed a bug in the text formatter pagination code where it incorrectly >> >> tried to annotate Comment and PI nodes with page number information. >> >> >> >> * Updated the v2v3 converter to do essentially what it did before v2.37 >> >> with respect to unicode downcoding, but with more explicit calls. >> >> >> >> * Added a base writer method to downcode reference punctuation. >> >> >> >> * Moved the list of (tag, attr) combinations that permit unicode values >> >> into util.unicode. Rewrote docwncode_punctuation() to only touch >> >> punctuation. >> >> >> >> * Restored lost trailing text after <contact> in <t> context for text >> >> output. >> >> >> >> -- Henrik Levkowetz <henrik@levkowetz.com> 12 Dec 2019 12:42:15 +0000 >> >> >> >> The preferred way to install xml2rfc is by doing 'pip install xml2rfc', >> >> and 'pip install --upgrade xml2rfc' to upgrade. If there are system- >> >> installed python modules which pip will not upgrade, you may have to >> >> use 'pip install --upgrade --no-deps xml2rfc' and install dependencies >> >> manually. >> >> >> >> The new version is also available through SVN checkout, with >> >> 'svn checkout http://svn.tools.ietf.org/svn/tools/xml2rfc/tags/cli/2.37.1' >> >> >> >> Regards, >> >> >> >> Henrik >> >> (via the mkrelease script) >> >> >> >> _______________________________________________ >> >> xml2rfc-dev mailing list >> >> xml2rfc-dev@ietf.org >> >> https://www.ietf.org/mailman/listinfo/xml2rfc-dev >> >> >> > >> > _______________________________________________ >> > xml2rfc-dev mailing list >> > xml2rfc-dev@ietf.org >> > https://www.ietf.org/mailman/listinfo/xml2rfc-dev >> > >> >> >
- [xml2rfc-dev] New xml2rfc release: v2.37.1 Henrik Levkowetz
- Re: [xml2rfc-dev] New xml2rfc release: v2.37.1 Martin Thomson
- Re: [xml2rfc-dev] New xml2rfc release: v2.37.1 Henrik Levkowetz
- Re: [xml2rfc-dev] New xml2rfc release: v2.37.1 Martin Thomson
- Re: [xml2rfc-dev] New xml2rfc release: v2.37.1 Henrik Levkowetz
- Re: [xml2rfc-dev] New xml2rfc release: v2.37.1 Martin Thomson