Exemplo n.º 1
0
def report_bug_legacy(exc_info, err_file):
    """Report a bug by just printing a message to the user."""
    trace.print_exception(exc_info, err_file)
    err_file.write('\n')
    import textwrap
    def print_wrapped(l):
        err_file.write(textwrap.fill(l,
            width=78, subsequent_indent='    ') + '\n')
    print_wrapped('bzr %s on python %s (%s)\n' % \
        (bzrlib.__version__,
        bzrlib._format_version_tuple(sys.version_info),
        platform.platform(aliased=1)))
    print_wrapped('arguments: %r\n' % sys.argv)
    print_wrapped(textwrap.fill(
        'plugins: ' + plugin.format_concise_plugin_list(),
        width=78,
        subsequent_indent='    ',
        ) + '\n')
    print_wrapped(
        'encoding: %r, fsenc: %r, lang: %r\n' % (
            osutils.get_user_encoding(), sys.getfilesystemencoding(),
            os.environ.get('LANG')))
    # We used to show all the plugins here, but it's too verbose.
    err_file.write(
        "\n"
        "*** Bazaar has encountered an internal error.  This probably indicates a\n"
        "    bug in Bazaar.  You can help us fix it by filing a bug report at\n"
        "        https://bugs.launchpad.net/bzr/+filebug\n"
        "    including this traceback and a description of the problem.\n"
        )
Exemplo n.º 2
0
def report_bug_legacy(exc_info, err_file):
    """Report a bug by just printing a message to the user."""
    trace.print_exception(exc_info, err_file)
    err_file.write('\n')
    import textwrap

    def print_wrapped(l):
        err_file.write(
            textwrap.fill(l, width=78, subsequent_indent='    ') + '\n')
    print_wrapped('bzr %s on python %s (%s)\n' % \
        (bzrlib.__version__,
        bzrlib._format_version_tuple(sys.version_info),
        platform.platform(aliased=1)))
    print_wrapped('arguments: %r\n' % sys.argv)
    print_wrapped(
        textwrap.fill(
            'plugins: ' + plugin.format_concise_plugin_list(),
            width=78,
            subsequent_indent='    ',
        ) + '\n')
    print_wrapped('encoding: %r, fsenc: %r, lang: %r\n' %
                  (osutils.get_user_encoding(), sys.getfilesystemencoding(),
                   os.environ.get('LANG')))
    # We used to show all the plugins here, but it's too verbose.
    err_file.write(
        "\n"
        "*** Bazaar has encountered an internal error.  This probably indicates a\n"
        "    bug in Bazaar.  You can help us fix it by filing a bug report at\n"
        "        https://bugs.launchpad.net/bzr/+filebug\n"
        "    including this traceback and a description of the problem.\n")
Exemplo n.º 3
0
def report_bug_to_apport(exc_info, stderr):
    """Report a bug to apport for optional automatic filing.

    :returns: The name of the crash file, or None if we didn't write one.
    """
    # this function is based on apport_package_hook.py, but omitting some of the
    # Ubuntu-specific policy about what to report and when

    # This import is apparently not used, but we're doing it so that if the
    # import fails, the exception will be caught at a higher level and we'll
    # report the error by other means.
    import apport

    crash_filename = _write_apport_report_to_file(exc_info)

    if crash_filename is None:
        stderr.write("\n"
            "apport is set to ignore crashes in this version of bzr.\n"
            )
    else:
        trace.print_exception(exc_info, stderr)
        stderr.write("\n"
            "You can report this problem to Bazaar's developers by running\n"
            "    apport-bug %s\n"
            "if a bug-reporting window does not automatically appear.\n"
            % (crash_filename))
        # XXX: on Windows, Mac, and other platforms where we might have the
        # apport libraries but not have an apport always running, we could
        # synchronously file now

    return crash_filename
Exemplo n.º 4
0
def report_bug_to_apport(exc_info, stderr):
    """Report a bug to apport for optional automatic filing.

    :returns: The name of the crash file, or None if we didn't write one.
    """
    # this function is based on apport_package_hook.py, but omitting some of the
    # Ubuntu-specific policy about what to report and when

    # This import is apparently not used, but we're doing it so that if the
    # import fails, the exception will be caught at a higher level and we'll
    # report the error by other means.
    import apport

    crash_filename = _write_apport_report_to_file(exc_info)

    if crash_filename is None:
        stderr.write(
            "\n"
            "apport is set to ignore crashes in this version of bzr.\n")
    else:
        trace.print_exception(exc_info, stderr)
        stderr.write(
            "\n"
            "You can report this problem to Bazaar's developers by running\n"
            "    apport-bug %s\n"
            "if a bug-reporting window does not automatically appear.\n" %
            (crash_filename))
        # XXX: on Windows, Mac, and other platforms where we might have the
        # apport libraries but not have an apport always running, we could
        # synchronously file now

    return crash_filename