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 lemburg
Recipients adlaiff6, christian.heimes, georg.brandl, jackdied, lemburg, rhettinger
Date 2009-07-13.08:56:26
SpamBayes Score 1.1773488e-10
Marked as misclassified No
Message-id <4A5AF6B9.8090604@egenix.com>
In-reply-to <1247438897.8.0.930772489294.issue1820@psf.upfronthosting.co.za>
Content
Raymond Hettinger wrote:
> Raymond Hettinger <rhettinger@users.sourceforge.net> added the comment:
> 
> In Py3.x, this fails:
>     "%s.%s.%s-%s-%s" % sys.version_info
> 
> The reason is that PyUnicode_Format() expects a real tuple, not a tuple
> lookalike.  The fix is to either have structseq inherit from tuple or to
> modify PyUnicode_Format() to handle structseq:
> 
>    if (PyCheck_StructSeq(args)) {
>       newargs = PyTuple_FromSequence(args);
>       if (newargs == NULL)
>           return NULL;
>       result = PyUncode_Format(format, newargs);
>       Py_DECREF(newargs);
>       return result;
>    }

-1

The special-casing of tuples vs. non-tuples for % is already
bad enough. Adding structseq as another special case doesn't
make that any better.

What's so hard about writing

"%s.%s.%s-%s-%s" % tuple(sys.version_info)

anyway ?
History
Date User Action Args
2009-07-13 08:56:28lemburgsetrecipients: + lemburg, georg.brandl, rhettinger, jackdied, christian.heimes, adlaiff6
2009-07-13 08:56:27lemburglinkissue1820 messages
2009-07-13 08:56:26lemburgcreate