[Patches] Parsing strings with \r\n or \r

Greg Ward gward@mems-exchange.org
Tue, 30 May 2000 14:13:41 -0400


On 30 May 2000, M.-A. Lemburg said:
> FYI, strings and Unicode have a method called .splitlines()
> which breaks lines at any combination of \r, \r\n or \n
> (the Unicode allows some more line break chars).

That's good to know, but not much help here: I'm patching the Python
tokenizer, so it's probably not good to rely on Python strings and
string methods and so forth at that point.

        Greg
-- 
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange / CNRI                           voice: +1-703-262-5376
Reston, Virginia, USA                            fax: +1-703-262-5367


Return-Path: <trentm@molotok.activestate.com>
Delivered-To: patches@python.org
Received: from molotok.activestate.com (molotok.activestate.com [199.60.48.208])
	by dinsdale.python.org (Postfix) with ESMTP id 469271CD40
	for <patches@python.org>; Tue, 30 May 2000 14:40:04 -0400 (EDT)
Received: (from trentm@localhost)
	by molotok.activestate.com (8.9.3/8.9.3) id LAA18225
	for patches@python.org; Tue, 30 May 2000 11:40:05 -0700
Resent-Message-Id: <200005301840.LAA18225@molotok.activestate.com>
Date: Tue, 30 May 2000 11:39:10 -0700
From: Trent Mick <trentm@activestate.com>
To: Guido van Rossum <guido@python.org>
Subject: Re: [Patches] Fix for bug PR#341
Message-ID: <20000530113910.H18024@activestate.com>
References: <392FEED2.90E262CB@lemburg.com> <200005301513.KAA06165@cj20424-a.reston1.va.home.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0pre3us
In-Reply-To: <200005301513.KAA06165@cj20424-a.reston1.va.home.com>
Resent-From: trentm@activestate.com
Resent-Date: Tue, 30 May 2000 11:40:05 -0700
Resent-To: patches@python.org
Resent-Sender: trentm@molotok.activestate.com
Sender: patches-admin@python.org
Errors-To: patches-admin@python.org
X-BeenThere: patches@python.org
X-Mailman-Version: 2.0beta3
Precedence: bulk
List-Id: Mailing list for submission of patches to Python <patches.python.org>

On Tue, May 30, 2000 at 10:13:59AM -0500, Guido van Rossum wrote:
> > Objects/stringobject.c:
> > 
> > Fix to avoid buffer overruns in %-formatting of integers.
> > 
> > Objects/unicodeobject.c:
> > 
> > Fix to avoid buffer overruns in %-formatting of integers.
> 
> Having read the patch and the discussion about magic numbers, I agree
> with Marc-Andre: let's apply the quick fix now, worry about
> correctness later.
> 
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> 
Ah, sorry to be quiet on this one. I found this overrun and have a slightly
better (I think) patch that tries to do better than a magic number and raises
an exception if the formatted string would overflow its buffer. I'tll try to
have something out today (tomorrow at the latest).


Trent

-- 
Trent Mick
trentm@activestate.com