/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Martin Pool
  • Date: 2007-09-21 03:07:10 UTC
  • mto: This revision was merged to the branch mainline in revision 2845.
  • Revision ID: mbp@sourcefrog.net-20070921030710-koafxqdakilf56t8
Report locale, encodings and plugins in traceback

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
58
58
lazy_import(globals(), """
59
59
from cStringIO import StringIO
60
60
import errno
 
61
import locale
61
62
import logging
62
63
import traceback
63
64
""")
65
66
import bzrlib
66
67
 
67
68
lazy_import(globals(), """
68
 
from bzrlib import debug
 
69
from bzrlib import (
 
70
    debug,
 
71
    osutils,
 
72
    plugin,
 
73
    )
69
74
""")
70
75
 
71
76
_file_handler = None
146
151
        if size <= 4 << 20:
147
152
            return
148
153
        old_fname = trace_fname + '.old'
149
 
        from osutils import rename
150
154
        rename(trace_fname, old_fname)
151
155
    except OSError:
152
156
        return
352
356
                        '.'.join(map(str, sys.version_info)),
353
357
                        sys.platform)
354
358
    print >>err_file, 'arguments: %r' % sys.argv
355
 
    print >>err_file
356
 
    print >>err_file, "** please send this report to bazaar@lists.ubuntu.com"
 
359
    err_file.write(
 
360
        'encoding: %r, fsenc: %r, lang: %r\n' % (
 
361
            osutils.get_user_encoding(), sys.getfilesystemencoding(),
 
362
            os.environ.get('LANG')))
 
363
    err_file.write(
 
364
        "plugins: %r\n" % (
 
365
            sorted(plugin.plugins().keys())))
 
366
    err_file.write(
 
367
        "\n"
 
368
        "** Please send this report to bazaar@lists.ubuntu.com\n"
 
369
        "   with a description of what you were doing when the\n"
 
370
        "   error occurred.\n"
 
371
        )