This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson
Date 2009-11-15.19:42:31
SpamBayes Score 2.6448926e-10
Marked as misclassified No
Message-id <1258314153.95.0.978747695294.issue7330@psf.upfronthosting.co.za>
In-reply-to
Content
There seems to be something wrong with the width handling code in 
PyUnicode_FromFormat;  or perhaps I'm misusing it.

To reproduce:  replace the line

   return PyUnicode_FromFormat("range(%R, %R)", r->start, r->stop);

in range_repr in Objects/rangeobject.c with

   return PyUnicode_FromFormat("range(%20R, %20R)", r->start, r->stop);

On my machine (OS X 10.6), this results in a segfault when invoking 
range_repr:

Python 3.2a0 (py3k:76311M, Nov 15 2009, 19:16:40) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> range(0, 10)
Segmentation fault

Perhaps these modifiers aren't supposed to be used with a width?
History
Date User Action Args
2009-11-15 19:42:34mark.dickinsonsetrecipients: + mark.dickinson
2009-11-15 19:42:33mark.dickinsonsetmessageid: <1258314153.95.0.978747695294.issue7330@psf.upfronthosting.co.za>
2009-11-15 19:42:32mark.dickinsonlinkissue7330 messages
2009-11-15 19:42:31mark.dickinsoncreate