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.

classification
Title: class/instance xyz has no attribute '_abc'
Type: Stage:
Components: Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Andreas.Hasenkopf
Priority: normal Keywords:

Created on 2011-07-07 10:13 by Andreas.Hasenkopf, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg139966 - (view) Author: Andreas Hasenkopf (Andreas.Hasenkopf) Date: 2011-07-07 10:13
I'm using 64bit Arch Linux and Python 2.7.2 compiled with GCC 4.6.1.

I have noticed in several ocassions that the interpreter is complaining about

AttributeError: XMLGenerator instance has no attribute '_write' (in case of module xml.sax.saxutils.XMLGenerator)

or

AttributeError: RendererGDK instance has no attribute '_text2path' (in case of matplotlib when trying to use TeX formatting of text)

When I have a look into the corresponding modules I can clearly see method definitions (e.g. def _write(self, text) in line 97 of xml/sax/saxutils.py

I have no clue, why it is happening in some modules, but not in others. If a write my own module containing a class with a _write method it is working fine.
If I write a class derived from xml.sax.saxutils.XMLGenerator and overwrite the _write method it is known to the system, but many of the attributes beginning with an underscore appear still to be unknown...

This is very odd?!
msg139976 - (view) Author: Andreas Hasenkopf (Andreas.Hasenkopf) Date: 2011-07-07 13:18
I'd like to mention that Python 2.6.7 does not show this erroneous behavior. In Python 2.6.7 I can call the _write method of xml.sax.saxutils.XMLGenerator...

Is this a bug or a feature in 2.7??
msg139977 - (view) Author: Andreas Hasenkopf (Andreas.Hasenkopf) Date: 2011-07-07 13:24
The problem appeared to be the package from the Arch Linux repo.
Compiling the source codes myselfes gave me a Python interpreter not showing this bug...
History
Date User Action Args
2022-04-11 14:57:19adminsetgithub: 56720
2011-07-07 14:40:39benjamin.petersonsetresolution: accepted -> not a bug
2011-07-07 13:24:19Andreas.Hasenkopfsetstatus: open -> closed
resolution: accepted
messages: + msg139977
2011-07-07 13:18:25Andreas.Hasenkopfsetmessages: + msg139976
components: - XML
2011-07-07 10:13:09Andreas.Hasenkopfcreate