Re: [xml2rfc-dev] New xml2rfc release: v2.37.1

"Martin Thomson" <mt@lowentropy.net> Fri, 13 December 2019 01:12 UTC

Return-Path: <mt@lowentropy.net>
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 207F7120A7D for <xml2rfc-dev@ietfa.amsl.com>; Thu, 12 Dec 2019 17:12:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=lowentropy.net header.b=QdIDP+Q2; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=cKtae6M3
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 sDK4QWuxS1Pw for <xml2rfc-dev@ietfa.amsl.com>; Thu, 12 Dec 2019 17:12:18 -0800 (PST)
Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 57BAC120A42 for <xml2rfc-dev@ietf.org>; Thu, 12 Dec 2019 17:12:18 -0800 (PST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id B3BAD7AD; Thu, 12 Dec 2019 20:12:17 -0500 (EST)
Received: from imap2 ([10.202.2.52]) by compute1.internal (MEProxy); Thu, 12 Dec 2019 20:12:17 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lowentropy.net; h=mime-version:message-id:in-reply-to:references:date:from:to :cc:subject:content-type; s=fm1; bh=Rcypjkvmw+fEsfsEFht9Avbnss+0 Y11DesSKo7I+/T4=; b=QdIDP+Q2AH9JmAaRa7dNKve2JS9VJ+hceoTJxW18zSmG ykxI6e3jw+Djl+BgTCjGFJKQHVppMo3Qsp0NW8qEeGYtkvmPBVX1QJnMtl3bDd39 rfd3ZN2w81q1l09yCEHgWFkVsHu5+5SGd/IgLFaAjcKoj2b4M4p3GyOFbDpvd6DO 6U5KApWXXiCHhCJeahPgUhQnPKc5XNb67KKUOKI2A8Fb2iOIZjCFLG+rj5jf4YDe iuuAz9gs+MBakPQXGtXDTIxUayTOss0xt6jc3SY+INOHH83gOYcef5D1ccR0hioO qQfam1MqVso3Nd7atkmaKY65Ra9RCoM2kRrhDYUhiQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Rcypjk vmw+fEsfsEFht9Avbnss+0Y11DesSKo7I+/T4=; b=cKtae6M38b9HTdEnRSOTTO 6T+tqGG0PJV6JGku6fRUGeD5PwDBj2C20spnc3wi2/axNpg9Zwc70pRtRwiUmv6e JkMY1VED3Br7qZvtSv2IfJxymqSyPgbs6Lpjx4cgntfah00/knCeirFif6y1x0bw VaHFWLgqp6GoNrFjhDWr+yaNwJ+MIOVHorAytvT+EASwSiQvCLt2cDPcouTT1KW8 I6/v5FCuTiVQREzhVHWHv9BSuSArKEmTPcC7DXsvI5+IO0hfdGKHK7pXt+0iJwiE u9QgrLVJuwvcdImBKhUbiczn9YMeFIX2p3+aeSoaLnBQ3Pe6DKnIcd70ixabuR9A ==
X-ME-Sender: <xms:ceXyXcYSSie8_bd5uM8L_BoreibItTqGUe3sNN2k5C7pVCXVQI9UoA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudelkedgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdforghr thhinhcuvfhhohhmshhonhdfuceomhhtsehlohifvghnthhrohhphidrnhgvtheqnecuff homhgrihhnpehivghtfhdrohhrghenucfrrghrrghmpehmrghilhhfrhhomhepmhhtsehl ohifvghnthhrohhphidrnhgvthenucevlhhushhtvghrufhiiigvpedt
X-ME-Proxy: <xmx:ceXyXV4MhdeP6ohAzgsvGTAMndqvQzniySV_QvDueFNGmSlqOapxaw> <xmx:ceXyXRzf2joMyZcIf-23W0vMVYGVvbNBm2ZGIda_v8H1TVa76gwAnA> <xmx:ceXyXc2y6o63H7qAMHyemBQYXxHsPDSf3oB9ycSAYoyF1zWueCQ5BA> <xmx:ceXyXf46ftl-DweGhnxetbE1MIX13c_YnMBPJ_Ga4bzefzuASdNjIw>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 01C3DE00A2; Thu, 12 Dec 2019 20:12:16 -0500 (EST)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.1.7-680-g58d4e90-fmstable-20191213v1
Mime-Version: 1.0
Message-Id: <b8f3f454-3fc5-4489-b987-ebad7c542c67@www.fastmail.com>
In-Reply-To: <BA233573-400B-4B81-AEE3-CB639022C89D@levkowetz.com>
References: <E1ifORf-0005KZ-EH@durif.tools.ietf.org> <a0199b25-65ae-4aa2-aec2-c227516fa6d4@www.fastmail.com> <BA233573-400B-4B81-AEE3-CB639022C89D@levkowetz.com>
Date: Fri, 13 Dec 2019 12:11:58 +1100
From: Martin Thomson <mt@lowentropy.net>
To: Henrik Levkowetz <henrik@levkowetz.com>
Cc: xml2rfc-dev@ietf.org
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/xml2rfc-dev/0ITXiHDMLnKHFNSSG2WTy48c7uQ>
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 01:12:23 -0000

Sorry, I foolishly left that out.

The code crashes if you have unicode punctuation because of this:

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
> > 
> 
>