Public bug reported:
On Centos 6 (64 bit), the following tests fail due to what looks like some kind of Python object printing quirk with the version that ships with RHEL 6 and derivatives: src/mailman/model/docs/membership.txt src/mailman/model/docs/users.txt
The errors all look like this:
File "/home/sgoss/mailman_clone/src/mailman/model/docs/membership.txt", line 296, in membership.txt Failed example: gwen_member.address = new_address Differences (ndiff with -expected +actual): Traceback (most recent call last): - ... - UnverifiedAddressError: email@example.com + File "/usr/lib64/python2.6/doctest.py", line 1248, in __run + compileflags, 1) in test.globs + File "<doctest membership.txt>", line 1, in <module> + gwen_member.address = new_address + File "/home/sgoss/mailman_clone/src/mailman/model/member.py", line 116, in address + raise UnverifiedAddressError(new_address) + UnverifiedAddressError: <unprintable UnverifiedAddressError object>
The system reports Python version 2.6.5.
This error does not seem to occur with Python 2.7 on Ubuntu 11.04.
One possibility is that for some reason when it comes to printing out those error objects, Python doesn't have a default encoding scheme for representing the embedded unicode strings in that particular context (email address in the above example).
** Affects: mailman Importance: Undecided Status: New
** Tags: mailman3
A quick fix to this is to convert the unicode addresses to string objects in the __str__ methods for those Error classes. The attached patch does just that, causing the tests to pass unchanged on Centos 6.
** Patch added: "mm3_826861.patch" https://bugs.launchpad.net/mailman/+bug/826861/+attachment/2280565/+files/mm...
I can't reproduce this with Python 2.6.7 on Ubuntu 11.10 64bit either. I'll have to bring up CentOS in a VM, but it would be interesting to know whether 2.6.7 possibly has a related fix, or Ubuntu, or something about the way CentOS builds Python. What's odd here is that there shouldn't be any non-ascii unicodes in the printed representation. Hmm...
Since recent code changes another test is failing in this way on Centos 6:
File "/home/sgoss/mailman_clone/src/mailman/model/docs/registration.txt", line 61, in registration.txt Failed example: registrar.register(mlist, '\firstname.lastname@example.org') Differences (ndiff with -expected +actual): Traceback (most recent call last): - ... - InvalidEmailAddressError: \email@example.com + File "/usr/lib64/python2.6/doctest.py", line 1248, in __run + compileflags, 1) in test.globs + File "<doctest registration.txt>", line 1, in <module> + registrar.register(mlist, '\firstname.lastname@example.org') + File "/home/sgoss/mailman_clone/src/mailman/app/registrar.py", line 60, in register + getUtility(IEmailValidator).validate(email) + File "/home/sgoss/mailman_clone/src/mailman/email/validate.py", line 69, in validate + raise InvalidEmailAddressError(email) + InvalidEmailAddressError: <unprintable InvalidEmailAddressError object>
** Changed in: mailman Status: New => Triaged
** Changed in: mailman Importance: Undecided => High
I finally managed to get a Centos 6 VM up and running. All tests pass for me without error. Does this still happen for you with bzr head? Note that I'm running in an en_US.utf8 locale - what about you? Maybe there are problems in other locales?
** Changed in: mailman Status: Triaged => Invalid
** Changed in: mailman Status: Invalid => Incomplete
This bug has been moved to the new gitlab repo here: https://gitlab.com/maxking/mailman/issues/6
Please ignore the above comment, the bug has been moved here: https://gitlab.com/mailman/mailman/issues/6