~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/crash.py

  • Committer: Alexander Belchenko
  • Date: 2012-03-29 08:34:13 UTC
  • mto: (6015.44.14 2.4)
  • mto: This revision was merged to the branch mainline in revision 6513.
  • Revision ID: bialix@ukr.net-20120329083413-d4bqqdtfn2yrxp4f
change st_dev, st_ino, st_uid, st_gid from int members to properties.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
 
17
18
"""Handling and reporting crashes.
18
19
 
19
20
A crash is an exception propagated up almost to the top level of Bazaar.
36
37
-Dno_apport.
37
38
"""
38
39
 
39
 
from __future__ import absolute_import
40
 
 
41
40
# for interactive testing, try the 'bzr assert-fail' command 
42
41
# or see http://code.launchpad.net/~mbp/bzr/bzr-fail
43
42
#
71
70
            return
72
71
    except ImportError, e:
73
72
        trace.mutter("couldn't find apport bug-reporting library: %s" % e)
 
73
        pass
74
74
    except Exception, e:
75
75
        # this should only happen if apport is installed but it didn't
76
76
        # work, eg because of an io error writing the crash file
77
 
        trace.mutter("bzr: failed to report crash using apport: %r" % e)
78
 
        trace.log_exception_quietly()
 
77
        stderr.write("bzr: failed to report crash using apport:\n "
 
78
            "    %r\n" % e)
 
79
        pass
79
80
    return report_bug_legacy(exc_info, stderr)
80
81
 
81
82
 
170
171
    pr['Platform'] = platform.platform(aliased=1)
171
172
    pr['UserEncoding'] = osutils.get_user_encoding()
172
173
    pr['FileSystemEncoding'] = sys.getfilesystemencoding()
173
 
    pr['Locale'] = os.environ.get('LANG', 'C')
 
174
    pr['Locale'] = os.environ.get('LANG')
174
175
    pr['BzrPlugins'] = _format_plugin_list()
175
176
    pr['PythonLoadedModules'] = _format_module_list()
176
177
    pr['BzrDebugFlags'] = pprint.pformat(debug.debug_flags)
259
260
        os.open(filename, 
260
261
            os.O_WRONLY|os.O_CREAT|os.O_EXCL,
261
262
            0600),
262
 
        'wb')
 
263
        'w')
263
264
 
264
265
 
265
266
def _format_plugin_list():