qconfig fails when no E-mail address in whoami

Bug #239534 reported by Mark Millard
2
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Undecided
Unassigned
QBzr
Fix Released
Medium
Alexander Belchenko

Bug Description

Context:

My whoami does not list an E-mail address. I'm just experimenting so far and so did not bother to list one. But qconfig has problems handling this (on Mac OS X 10.5.3). Other qbzr commands seem to be generally working.

Problem as reqported by trying the command:

bzr qconfig
bzr: ERROR: exceptions.NameError: global name 'errors' is not defined

Traceback (most recent call last):
  File "/Library/Python/2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/Library/Python/2.5/site-packages/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/Library/Python/2.5/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/qbzr/__init__.py", line 275, in run
    window = QBzrConfigWindow()
  File "/Library/Python/2.5/site-packages/bzrlib/lazy_import.py", line 125, in __call__
    return obj(*args, **kwargs)
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/qbzr/config.py", line 143, in __init__
    self.load()
  File "/Library/Python/2.5/site-packages/bzrlib/plugins/qbzr/config.py", line 156, in load
    except errors.NoEmailInUsername:
NameError: global name 'errors' is not defined

bzr 1.5 on python 2.5.1 (darwin)
arguments: ['/usr/local/bin/bzr', 'qconfig']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /Library/Python/2.5/site-packages/bzrlib/plugins/bzrtools [1.5.0]
  launchpad /Library/Python/2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  qbzr /Library/Python/2.5/site-packages/bzrlib/plugins/qbzr [0.9.0]
  rebase /Library/Python/2.5/site-packages/bzrlib/plugins/rebase [0.3.0dev0]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

The code referenced is:

    def load(self):
        """Load the configuration."""
        config = GlobalConfig()
        parser = config._get_parser()

        # Name & e-mail
        username = config.username()
        if username:
            self.nameEdit.setText(extract_name(username, strict=True))
            try:
                self.emailEdit.setText(extract_email_address(username))
            except errors.NoEmailInUsername:
                pass

Tags: qconfig
Revision history for this message
John A Meinel (jameinel) wrote :

this is strictly in qbzr. It is trying to access "errors.NoName..." exception, but it forgot to "from bzrlib import errors" earlier in the script.

Revision history for this message
Mark Millard (markmi-dsl-only) wrote :

My first guess is that the lazy_import of errors is involved and that this ends up being the first use of errors. But my background knowledge in the areas involved is limited.

James Westby (james-w)
Changed in bzr:
status: New → Invalid
Changed in qbzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Alexander Belchenko (bialix) wrote :

bugfix is trivial: we should import errors from bzrlib. See attached diff. Fix available in the trunk branch.

Changed in qbzr:
assignee: nobody → bialix
status: Confirmed → Fix Committed
Changed in qbzr:
milestone: none → 0.9.1
Changed in qbzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.