Unhelpful error message

Jon Ribbens jon+usenet at unequivocal.eu
Tue Jun 6 15:10:53 EDT 2017


On 2017-06-06, Thomas Nyberg <tomuxiong at gmx.com> wrote:
> On 06/06/2017 11:46 AM, Jon Ribbens wrote:
>> On 2017-06-06, Thomas Nyberg <tomuxiong at gmx.com> wrote:
>>> My changes feel a bit hacky. I wanted to just drop a straight repr() in,
>>> but I didn't want to change the code too much since I assume the string
>>> formatting is already there for a reason (e.g. "%.200s").
>> 
>> Just change the '%.200s' to '%.200R' and it should work. The '.200'
>> isn't necessary to avoid buffer-overflow or anything, but an error
>> message of unlimited length is probably a good thing to avoid anyway ;-)
>
> That causes a segfault for me. I.e. if I use this patch:

Oh yes, sorry, I didn't realise that this convert-string-to-float
function in the Python source (as opposed to the other
convert-string-to-float function in the Python source) was taking
a char* not a PyObject*.



More information about the Python-list mailing list