[MERGE] EmailMessage, the façade version (v3)
John Arbash Meinel
john at arbash-meinel.com
Fri Jul 20 15:45:58 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
> John Arbash Meinel has voted +1.
> Status is now: Semi-approved
> Comment:
> As I already started merging it after your first post, I'll go ahead and
> pull out msgobj and submit again.
>
> For details, see:
> http://bundlebuggy.aaronbentley.com/request/%3C20070719213548.GA4891%40chistera.yi.org%3E
It actually could also have been done by setting self._msgobj = None in
__setitem__.
However, I think the standard case is that you will build an email and
send it. And not that you will be trying to rebuild it over and over
again, even changing something small each time. So I'm doing it mostly
for 'correctness' even if I don't think it is the standard way of testing.
Ugh, we have another problem. The tests fail on python2.5. I get a warning:
/home/jameinel/dev/bzr/jam-integration/bzrlib/tests/test_email_message.py:97:
UnicodeWarning: Unicode equal comparison failed to convert both
arguments to Unicode - interpreting them as being unequal
'b\xf3dy': SIMPLE_MESSAGE_8BIT,
/home/jameinel/dev/bzr/jam-integration/bzrlib/tests/test_email_message.py:223:
UnicodeWarning: Unicode equal comparison failed to convert both
arguments to Unicode - interpreting them as being unequal
'P\xe9rez': ('P\xe9rez', '8-bit'),
I believe the specific bug is that you can't put u'P\xe9rez', and
'P\xe9rez' into the same dictionary. Or some bug like that.
The test seems to pass, but it will fail 'make check' with python2.5.
So I fixed this dictionaries up so that they will use strings that are
slightly different.
So instead of using:
u'P\xe9rez'
and
'P\xe9rez'
I'm using
u'P\xe9rez'
and
'P\xe8rez'
I think the problem is that the way python's hash function works
u'P\xe9rez' hashes to the same value as 'P\xe9rez'. *but* the latter
cannot be cast to a Unicode string (from ascii) so it is technically a
miss. I think it is correct to miss, I don't know why they give a
UnicodeWarning for it in python2.5.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGoMqmJdeBCYSNAAMRAmJ+AKDGBzeXM8YB9PdP72hh3+jwCGkuxgCeM6mH
LkkTen5Y/OWlEv/5TU3U75M=
=tG3+
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list