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 meador.inge
Recipients Trundle, flox, meador.inge, vstinner
Date 2010-09-05.20:36:37
SpamBayes Score 1.6240398e-11
Marked as misclassified No
Message-id <1283718999.43.0.278522453453.issue9756@psf.upfronthosting.co.za>
In-reply-to
Content
> To fix the segfault, I suppose that we use a more strict validation on 
> the input type. Eg. Use PyUnicode_Check() instead of 
> PyObject_IsInstance()?

Where would the more strict validation take place?  This problem is not unique to Unicode objects:

motherbrain:py3k minge$ ./python.exe 
Python 3.2a2 (py3k:84541, Sep  5 2010, 15:11:19) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class MyClass(object):
...    def __init__(self):
...       self.pwn = None
...    def __getattribute__(self, name):
...       return getattr(187, name)
... 
[49633 refs]
>>> instance = MyClass()
[49640 refs]
>>> int.bit_length(instance)
Assertion failed: (PyLong_Check(v)), function long_bit_length, file Objects/longobject.c, line 4397.
Abort trap
History
Date User Action Args
2010-09-05 20:36:39meador.ingesetrecipients: + meador.inge, vstinner, Trundle, flox
2010-09-05 20:36:39meador.ingesetmessageid: <1283718999.43.0.278522453453.issue9756@psf.upfronthosting.co.za>
2010-09-05 20:36:37meador.ingelinkissue9756 messages
2010-09-05 20:36:37meador.ingecreate