/
usr
/
lib64
/
python2.6
/
site-packages
/
/usr/lib64/python2.6/site-packages
mkdir
upload
Name
Size
Mode
Actions
backports/
-
0755
rm
cairo/
-
0755
rm
cffi/
-
0755
rm
cffi-1.2.1-py2.6.egg-info/
-
0755
rm
Cheetah/
-
0755
rm
Cheetah-2.4.1-py2.6.egg-info/
-
0755
rm
cryptography/
-
0755
rm
cryptography-1.0.2-py2.6.egg-info/
-
0755
rm
curl/
-
0755
rm
dns/
-
0755
rm
gpgme/
-
0755
rm
gtk-2.0/
-
0755
rm
jinja2/
-
0755
rm
Jinja2-2.2.1-py2.6.egg-info/
-
0755
rm
lxml/
-
0755
rm
lxml-2.2.3-py2.6.egg-info/
-
0755
rm
M2Crypto/
-
0755
rm
matplotlib/
-
0755
rm
meld3/
-
0755
rm
modulator/
-
0755
rm
mpl_toolkits/
-
0755
rm
msgpack/
-
0755
rm
msgpack_python-0.4.6-py2.6.egg-info/
-
0755
rm
msgpack_python-0.4.7-py2.6.egg-info/
-
0755
rm
mx/
-
0755
rm
MySQLdb/
-
0755
rm
MySQL_python-1.2.5-py2.6.egg-info/
-
0755
rm
netifaces-0.10.4-py2.6.egg-info/
-
0755
rm
numpy/
-
0755
rm
OpenSSL/
-
0755
rm
policycoreutils/
-
0755
rm
problem/
-
0755
rm
psutil/
-
0755
rm
pylve-2.1-py2.6.egg-info/
-
0755
rm
pynche/
-
0755
rm
PyYAML-3.11-py2.6.egg-info/
-
0755
rm
report/
-
0755
rm
reportclient/
-
0755
rm
rpm/
-
0755
rm
selinux/
-
0755
rm
sepolgen/
-
0755
rm
setools/
-
0755
rm
simplejson/
-
0755
rm
simplejson-3.8.0-py2.6.egg-info/
-
0755
rm
simplejson-3.8.2-py2.6.egg-info/
-
0755
rm
wrapt/
-
0755
rm
wrapt-1.10.5-py2.6.egg-info/
-
0755
rm
wrapt-1.10.8-py2.6.egg-info/
-
0755
rm
yaml/
-
0755
rm
abrt.pth
30
0644
edit
dl
rm
abrt_exception_handler.py
7077
0644
edit
dl
rm
abrt_exception_handler.pyc
4805
0644
edit
dl
rm
abrt_exception_handler.pyo
4805
0644
edit
dl
rm
acutilmodule.so
6024
0644
edit
dl
rm
audit.py
43352
0644
edit
dl
rm
audit.pyc
41967
0644
edit
dl
rm
audit.pyo
41967
0644
edit
dl
rm
auparse.so
48616
0755
edit
dl
rm
dmidecode.py
3461
0644
edit
dl
rm
dmidecode.pyc
2320
0644
edit
dl
rm
dmidecode.pyo
2320
0644
edit
dl
rm
dmidecodemod.so
185104
0755
edit
dl
rm
drv_libxml2.py
15061
0644
edit
dl
rm
drv_libxml2.pyc
11329
0644
edit
dl
rm
drv_libxml2.pyo
11329
0644
edit
dl
rm
egenix_mx_base-3.1.1-py2.6.egg-info
3464
0644
edit
dl
rm
ethtool-0.6-py2.6.egg-info
288
0644
edit
dl
rm
ethtool.so
38280
0755
edit
dl
rm
gudev.so
25984
0644
edit
dl
rm
iwlib-1.0-py2.6.egg-info
358
0644
edit
dl
rm
iwlib.so
8960
0644
edit
dl
rm
libxml2.py
339776
0644
edit
dl
rm
libxml2.pyc
444924
0644
edit
dl
rm
libxml2.pyo
444924
0644
edit
dl
rm
libxml2mod.a
566762
0644
edit
dl
rm
libxml2mod.la
1015
0755
edit
dl
rm
libxml2mod.so
368072
0755
edit
dl
rm
M2Crypto-0.20.2-py2.6.egg-info
1160
0644
edit
dl
rm
matplotlib-0.99.1.1-py2.6.egg-info
606
0644
edit
dl
rm
meld3-0.6.7-py2.6.egg-info
259
0644
edit
dl
rm
netifaces.so
43849
0644
edit
dl
rm
numpy-1.4.1-py2.6.egg-info
1610
0644
edit
dl
rm
ordereddict-1.2-py2.6.egg-info
183
0644
edit
dl
rm
policycoreutils_default_encoding-0.1-py2.6.egg-info
300
0644
edit
dl
rm
psutil-0.7.0-py2.6.egg-info
9894
0644
edit
dl
rm
pycurl-7.19.0-py2.6.egg-info
366
0644
edit
dl
rm
pycurl.so
69504
0755
edit
dl
rm
pygpgme-0.1-py2.6.egg-info
836
0644
edit
dl
rm
pygtk.pth
8
0644
edit
dl
rm
pygtk.py
2966
0644
edit
dl
rm
pygtk.pyc
2082
0644
edit
dl
rm
pygtk.pyo
1789
0644
edit
dl
rm
pylab.py
90
0644
edit
dl
rm
pylab.pyc
242
0644
edit
dl
rm
pylab.pyo
242
0644
edit
dl
rm
pylve.so
19552
0755
edit
dl
rm
python_dmidecode-3.10.15-py2.6.egg-info
311
0644
edit
dl
rm
README
119
0644
edit
dl
rm
semanage.py
41434
0644
edit
dl
rm
semanage.pyc
52767
0644
edit
dl
rm
semanage.pyo
52767
0644
edit
dl
rm
seobject.py
80758
0755
edit
dl
rm
seobject.pyc
79967
0644
edit
dl
rm
seobject.pyo
79967
0644
edit
dl
rm
setools-1.0-py2.6.egg-info
206
0644
edit
dl
rm
snack.py
30643
0644
edit
dl
rm
snack.pyc
40757
0644
edit
dl
rm
snack.pyo
40757
0644
edit
dl
rm
sqlitecachec.py
2510
0644
edit
dl
rm
sqlitecachec.pyc
2176
0644
edit
dl
rm
sqlitecachec.pyo
2176
0644
edit
dl
rm
yum_metadata_parser-1.1.2-py2.6.egg-info
213
0644
edit
dl
rm
_audit.so
152064
0755
edit
dl
rm
_cffi_backend.so
386213
0644
edit
dl
rm
_dbus_bindings.so
154032
0644
edit
dl
rm
_dbus_glib_bindings.so
8384
0644
edit
dl
rm
_mysql.so
139827
0644
edit
dl
rm
_mysql_exceptions.py
2352
0644
edit
dl
rm
_mysql_exceptions.pyc
4257
0644
edit
dl
rm
_psutil_linux.so
8968
0644
edit
dl
rm
_psutil_posix.so
5576
0644
edit
dl
rm
_semanage.so
225384
0644
edit
dl
rm
_snackmodule.so
35504
0755
edit
dl
rm
_sqlitecache.so
45320
0644
edit
dl
rm
_yaml.so
186176
0644
edit
dl
rm
Edit:
/usr/lib64/python2.6/site-packages/abrt_exception_handler.py
(7077B)
#:mode=python: # -*- coding: utf-8 -*- ## Copyright (C) 2001-2005 Red Hat, Inc. ## Copyright (C) 2001-2005 Harald Hoyer <harald@redhat.com> ## Copyright (C) 2009 Jiri Moskovcak <jmoskovc@redhat.com> ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """ Module for the ABRT exception handling hook """ import sys import os def write_dump(tb): if sys.argv[0][0] == "/": executable = os.path.abspath(sys.argv[0]) else: # We don't know the path. # (BTW, we *can't* assume the script is in current directory.) executable = sys.argv[0] # Open ABRT daemon's socket and write data to it try: import socket s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.settimeout(5) try: s.connect("/var/run" + "/abrt/abrt.socket") s.sendall("PUT / HTTP/1.1\r\n\r\n") s.sendall("PID=%s\0" % os.getpid()) s.sendall("EXECUTABLE=%s\0" % executable) s.sendall("ANALYZER=Python\0") s.sendall("TYPE=Python\0") s.sendall("BASENAME=pyhook\0") # This handler puts a short(er) crash descr in 1st line of the backtrace. # Example: # CCMainWindow.py:1:<module>:ZeroDivisionError: integer division or modulo by zero s.sendall("REASON=%s\0" % tb.splitlines()[0]) s.sendall("BACKTRACE=%s\0" % tb) s.shutdown(socket.SHUT_WR) # Read the response and log if there's anything wrong response = "" while True: buf = s.recv(256) if not buf: break response += buf except socket.timeout, ex: import syslog syslog.syslog("communication with ABRT daemon failed: %s" % str(ex)) s.close() parts = response.split() if (len(parts) < 2 or (not parts[0].startswith("HTTP/")) or (not parts[1].isdigit()) or (int(parts[1]) >= 400)): import syslog syslog.syslog("error sending data to ABRT daemon: %s" % response) except Exception, ex: import syslog syslog.syslog("can't communicate with ABRT daemon, is it running? %s" % str(ex)) def conf_enabled(var_name): try: conf = problem.load_plugin_conf_file("python.conf") except: return -1 else: conf.get(var_name, -1) def handleMyException((etype, value, tb)): """ The exception handling function. progname - the name of the application version - the version of the application """ try: # Restore original exception handler sys.excepthook = sys.__excepthook__ # pylint: disable-msg=E1101 import errno # Ignore Ctrl-C # SystemExit rhbz#636913 -> this exception is not an error if etype in [KeyboardInterrupt, SystemExit]: return sys.__excepthook__(etype, value, tb) # Ignore EPIPE: it happens all the time # Testcase: script.py | true, where script.py is: ## #!/usr/bin/python ## import os ## import time ## time.sleep(1) ## os.write(1, "Hello\n") # print "Hello" wouldn't be the same # if etype == IOError or etype == OSError: if value.errno == errno.EPIPE: return sys.__excepthook__(etype, value, tb) import syslog syslog.openlog("abrt") # Ignore interactive Python and similar # Check for first "-" is meant to catch "-c" which appears in this case: ## $ python -c 'import sys; print "argv0 is:%s" % sys.argv[0]' ## argv0 is:-c # Are there other cases when sys.argv[0][0] is "-"? if not sys.argv[0] or sys.argv[0][0] == "-": syslog.syslog("detected unhandled Python exception") raise Exception # Ignore scripts with relative path unless "RequireAbsolutePath = no". # (In this case we can't reliably determine package) syslog.syslog("detected unhandled Python exception in '%s'" % sys.argv[0]) if sys.argv[0][0] != "/": if conf_enabled("RequireAbsolutePath") != 0: raise Exception import traceback elist = traceback.format_exception(etype, value, tb) if tb != None and etype != IndentationError: tblast = traceback.extract_tb(tb, limit=None) if len(tblast): tblast = tblast[len(tblast)-1] extxt = traceback.format_exception_only(etype, value) if tblast and len(tblast) > 3: ll = [] ll.extend(tblast[:3]) ll[0] = os.path.basename(tblast[0]) tblast = ll ntext = "" for t in tblast: ntext += str(t) + ":" text = ntext text += extxt[0] text += "\n" text += "".join(elist) trace = tb while trace.tb_next: trace = trace.tb_next frame = trace.tb_frame text += ("\nLocal variables in innermost frame:\n") try: for (key, val) in frame.f_locals.items(): text += "%s: %s\n" % (key, repr(val)) except: pass else: text = str(value) + "\n" text += "\n" text += "".join(elist) # Send data to the daemon write_dump(text) except: # Silently ignore any error in this hook, # to not interfere with other scripts pass return sys.__excepthook__(etype, value, tb) def installExceptionHandler(): """ Install the exception handling function. """ sys.excepthook = lambda etype, value, tb: handleMyException((etype, value, tb)) # install the exception handler when the abrt_exception_handler # module is imported try: installExceptionHandler() except Exception, e: # TODO: log errors? # OTOH, if abrt is deinstalled uncleanly # and this file (sitecustomize.py) exists but # abrt_exception_handler module does not exist, we probably # don't want to irritate admins... pass if __name__ == '__main__': # test exception raised to show the effect div0 = 1 / 0 # pylint: disable-msg=W0612 sys.exit(0) __author__ = "Harald Hoyer <harald@redhat.com>"
Save
cmd:
run