Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#25054 - [Python] class/instance ... has no attribute '_...'
Attached to Project:
Arch Linux
Opened by Andreas Hasenkopf (CrazyScientist) - Thursday, 07 July 2011, 11:22 GMT
Last edited by Stéphane Gaudreault (stephane) - Monday, 11 July 2011, 16:17 GMT
Opened by Andreas Hasenkopf (CrazyScientist) - Thursday, 07 July 2011, 11:22 GMT
Last edited by Stéphane Gaudreault (stephane) - Monday, 11 July 2011, 16:17 GMT
|
DetailsDescription:
On several occasions I discountered a "very serious" problem regarding modules. The interpreter is complaining about the following AttributeError: "class/instance xyz has no attribute '_abc'" For example xml.sax.saxutils.XMLGenerator (=xyz) and any method/attribute beginning with an underscore (=_abc) I also encountered this problem with matplotlib's TeX formatting of text. Additional info: * package version(s) python2 2.7.2-2 python2-numpy 1.5.1-2 python2-scipy 0.9.0-1 python2-matplotlib 1.0.1-2 * config and/or log files etc. Steps to reproduce: - Import xml.sax.saxutils - Initiate XMLGenerator() - Call _write() method thereof or any other method/attribute beginning with an underscore or - Run my script: http://sourceforge.net/projects/emcdutilityprog/files/eels.tar.gz/download - Open settings dialog - Save settings |
This task depends upon
Closed by Stéphane Gaudreault (stephane)
Monday, 11 July 2011, 16:17 GMT
Reason for closing: Works for me
Additional comments about closing: I am closing this as "work for me", please feel free to reopen and add more informations if needed.
Monday, 11 July 2011, 16:17 GMT
Reason for closing: Works for me
Additional comments about closing: I am closing this as "work for me", please feel free to reopen and add more informations if needed.
Downloading a recent version of Python 2.7.2 from python.org and compiling it results in an interpreter not showing this bug.
- python2 emcd.py
- Open settings dialog
- Save settings
No crash and I got a file ~/.config/eels/eels-settings.xml
<?xml version="1.0" encoding="utf-8"?>
<EELS-GUI-Settings>
<backgr_model>0</backgr_model>
<emcd_subplot>True</emcd_subplot>
<emcd_sig_mag>5.7</emcd_sig_mag>
<filter_model>1</filter_model>
<show_unprocessed>True</show_unprocessed>
<emcd_definition>True</emcd_definition>
<gauss_kernel>1.0</gauss_kernel>
</EELS-GUI-Settings>
To help the discussion, could you please provide me a minimal example (a few lines) that crash for you ?
The first example is with the interpreter from the package, the second one contains a Traceback emitted by my script upon applying new settings and the third one is the same code as in the first example but with an interpreter compiled on my machine.
I hope it helps...
# python2
Python 2.7.2 (default, Jun 12 2011, 03:11:18)
[GCC 4.6.0 20110603 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.sax.saxutils
>>> x= xml.sax.saxutils.XMLGenerator()
>>> x._write("Hello World")
Hello World>>>
Tested on 2 laptops, same result on both i686 and x86_64 with python2 2.7.2-2.
Works also with python python 3.2-2.
If you are interested in investigating this problem further, I have attached my /proc/cpuinfo.
In the meantime I will simply replace the python package with the self-compiled one...
Thanks so far
Notice the difference between those two examples:
andi@x200:~$ python2.7
Python 2.7.2 (default, Jul 7 2011, 15:17:24)
[GCC 4.6.1] on linux2
>>> import xml.sax.saxutils
>>> x=xml.sax.saxutils.XMLGenerator()
>>> x._write("Hallo")
Hallo>>>
andi@x200:~$ python2
Python 2.7.2 (default, Jul 8 2011, 12:22:00)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.sax.saxutils
>>> x=xml.sax.saxutils.XMLGenerator()
>>> x._write("Hallo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: XMLGenerator instance has no attribute '_write'
1) sudo pacman -S devtools
2) Create a chroot:
sudo mkarchroot -C /usr/share/devtools/pacman-extra.conf ~/chroot_test 'base python2'
3) login into the chroot :
sudo mkarchroot -r /bin/bash ~/chroot_test
4) . /etc/profile
and then test python2 package.
Before this installation orgy I removed all python-relevant packages except the python2 package itself using pacman. Under these conditions I also could run the examples posted above. I tried to install the previously removed packages one by one to determine the "malicious" one. As some have complex dependencies (can't install one by one) I ran into some problems with pacman when I tried to remove single packages again: pacman could not resolve the dependencies and remove them...
The actual problem seem to be in another package.