Tests don't pass!! [PATCH]

Magnus Therning magnus at therning.org
Thu Apr 14 10:57:14 BST 2005

On Thu, Apr 14, 2005 at 08:48:03AM +1000, Martin Pool wrote:
>On Wed, 2005-04-13 at 19:26 +0200, Simon Ekstrand wrote:
>> Olivier Grisel <olivier.grisel at ensta.org> writes:
>> > Erik Bågfors wrote:
>> >> I rsynced as I read this mail, tried the tests and they all passed.
>> >> /Erik
>> >
>> > As I did but they are broken on my box (up2date Ubuntu Hoary with cElementTree):
>> >
>> > ogrisel at groyours:~/bazaar-ng $ python -c "import locale; print
>> > locale.getpreferredencoding()"
>> > ISO-8859-15
>> The failed tests seem to be caused by the already reported bug where
>> certain operations fail if BZREMAIL or EMAIL aren't set.
>Yes, they do.  The test framework is such that there can be a  lot of
>cascading failures if something goes wrong.
>I will take in the patch for it shortly.

In case you didn't get around to creating a patch yet I've attached one
that makes the tests pass.


Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
magnus at therning.org

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Long-range planning does not deal with future decisions, but with the
future of present decisions.
     -- Peter F. Drucker
-------------- next part --------------
Index: bazaar-ng/my.dev/bzrlib/osutils.py
--- bazaar-ng.orig/my.dev/bzrlib/osutils.py	2005-04-14 10:33:42.523825267 +0100
+++ bazaar-ng/my.dev/bzrlib/osutils.py	2005-04-14 10:46:07.228968977 +0100
@@ -190,9 +190,9 @@
 def user_email():
     """Return just the email component of a username."""
     e = os.environ.get('BZREMAIL') or os.environ.get('EMAIL')
-    import locale
-    e = e.decode(locale.getpreferredencoding())
     if e:
+        import locale
+        e = e.decode(locale.getpreferredencoding())
         m = _EMAIL_RE.search(e)
         if not m:
             bailout('%r is not a reasonable email address' % e)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050414/d8e2cd6b/attachment.pgp 

More information about the bazaar mailing list