A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-September/028981.html below:

[Python-Dev] Strange bug only happens with Python 2.2

[Python-Dev] Strange bug only happens with Python 2.2Gerhard Häring gerhard.haering@gmx.de
Sat, 28 Sep 2002 00:07:40 +0200
* Michael Hudson <mwh@python.net> [2002-09-27 16:39 +0100]:
> On Fri, 27 Sep 2002, Gerhard Häring wrote:
> 
> > This is somewhat off-topic, but I'm hoping maybe someone can give a hint
> > why this only happens on Python 2.2.1.
> 
> Guessing, but the (Jeremy's?) changes I recently backported to 
> classobject.c on the release22-maint branch might relate to this.

Maybe. I've not viewed the control flow in a debugger, but my tries to come up
with a minimalistic test case and my gut feeling says that this piece of code
has something to do with it:

static PyObject *PgLargeObject_getattr(PgLargeObject *self, char* attr)
{
    PyObject *res;

    res = Py_FindMethod(PgLargeObject_methods, (PyObject *)self, attr);
    if (res != NULL)
        return res;
    PyErr_Clear();

    if (strcmp(attr, "closed") == 0)
        return Py_BuildValue("l", (long)(self->lo_fd == -1));

    if (!strcmp(attr, "__module__"))
        return Py_BuildValue("s", MODULE_NAME);

    if (!strcmp(attr, "__class__")) {
        printf("__class__ accessed!\n");
        return Py_BuildValue("s", self->ob_type->tp_name);
    }

    return PyMember_Get((char *)self, PgLargeObject_members, attr);
}

from which I can see that isinstance tries to access the __class__ attribute.
Am I supposed to /not/ provide a __class__ attribute for classic types?

I haven't looked into the python22-maint changelogs yet, but I couldn't find
any related registered SF bug.

-- Gerhard



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4