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 eric.smith
Recipients eric.smith, martin.panter, petr.viktorin
Date 2016-02-05.15:14:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454685284.03.0.473409112762.issue26287@psf.upfronthosting.co.za>
In-reply-to
Content
The problem has to do with refcounting when an error occurs. Adjusting the title accordingly.

I'm not sure yet if the problem is in PyObject_Format(), or in handling errors in the eval loop when processing FORMAT_VALUE opcodes. I'm slowly tracking it down. It doesn't happen with format(), so I suspect it's in FORMAT_VALUE.

Here's an example showing the error with a large, non-cached int. You need to call it twice to trigger the refcount problem.

>>> f'{1000:j}'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Unknown format code 'j' for object of type 'int'
>>> f'{1000:j}'
Fatal Python error: Objects/tupleobject.c:233 object at 0x7f904006b360 has negative ref count -2604246222170760230

Current thread 0x00007f9041278700 (most recent call first):
Aborted (core dumped)
History
Date User Action Args
2016-02-05 15:14:44eric.smithsetrecipients: + eric.smith, petr.viktorin, martin.panter
2016-02-05 15:14:44eric.smithsetmessageid: <1454685284.03.0.473409112762.issue26287@psf.upfronthosting.co.za>
2016-02-05 15:14:44eric.smithlinkissue26287 messages
2016-02-05 15:14:43eric.smithcreate