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 serhiy.storchaka
Recipients MSeifert, josh.r, serhiy.storchaka
Date 2017-03-13.18:46:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489430773.45.0.693270841967.issue29800@psf.upfronthosting.co.za>
In-reply-to
Content
PyUnicode_FromFormat() crashes in debug build if the argument for %U is not a unicode string.

I thought about using %S. This would correspond possible Python implementation (`'%s=%r' % (key, value)`). But in that case we should increase refcounts of key and value (and maybe even pto->kw) since custom __str__ of the key can remove the value from the dict and make the value variable the hanging reference.

I would prefer never failing __repr__, but other core developers have other opinion. Currently partial.__repr__ raises an exception on deep recursion and when the repr of any argument raises an exception.

Current Michael's patch LGTM, but if his want to suggest the solution with %S it would LGTM too.
History
Date User Action Args
2017-03-13 18:46:13serhiy.storchakasetrecipients: + serhiy.storchaka, josh.r, MSeifert
2017-03-13 18:46:13serhiy.storchakasetmessageid: <1489430773.45.0.693270841967.issue29800@psf.upfronthosting.co.za>
2017-03-13 18:46:13serhiy.storchakalinkissue29800 messages
2017-03-13 18:46:13serhiy.storchakacreate