~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Naoki INADA
  • Date: 2009-10-29 10:01:19 UTC
  • mto: (4634.97.3 2.0)
  • mto: This revision was merged to the branch mainline in revision 4798.
  • Revision ID: inada-n@klab.jp-20091029100119-uckv9t7ej2qrghw3
import doc-ja rev90

Show diffs side-by-side

added added

removed removed

Lines of Context:
432
432
    elif isinstance(exc_object, KeyboardInterrupt):
433
433
        err_file.write("bzr: interrupted\n")
434
434
        return errors.EXIT_ERROR
 
435
    elif isinstance(exc_object, MemoryError):
 
436
        err_file.write("bzr: out of memory\n")
 
437
        return errors.EXIT_ERROR
435
438
    elif isinstance(exc_object, ImportError) \
436
439
        and str(exc_object).startswith("No module named "):
437
440
        report_user_error(exc_info, err_file,
478
481
 
479
482
def report_bug(exc_info, err_file):
480
483
    """Report an exception that probably indicates a bug in bzr"""
481
 
    print_exception(exc_info, err_file)
482
 
    err_file.write('\n')
483
 
    err_file.write('bzr %s on python %s (%s)\n' % \
484
 
                       (bzrlib.__version__,
485
 
                        bzrlib._format_version_tuple(sys.version_info),
486
 
                        sys.platform))
487
 
    err_file.write('arguments: %r\n' % sys.argv)
488
 
    err_file.write(
489
 
        'encoding: %r, fsenc: %r, lang: %r\n' % (
490
 
            osutils.get_user_encoding(), sys.getfilesystemencoding(),
491
 
            os.environ.get('LANG')))
492
 
    err_file.write("plugins:\n")
493
 
    for name, a_plugin in sorted(plugin.plugins().items()):
494
 
        err_file.write("  %-20s %s [%s]\n" %
495
 
            (name, a_plugin.path(), a_plugin.__version__))
496
 
    err_file.write(
497
 
"""\
498
 
*** Bazaar has encountered an internal error.
499
 
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
500
 
    including this traceback, and a description of what you
501
 
    were doing when the error occurred.
502
 
""")
 
484
    from bzrlib.crash import report_bug
 
485
    report_bug(exc_info, err_file)