[Bug 826861] [NEW] doctests failing on Centos 6 due to "unprintable" error objects
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: gperson@example.com + File "/usr/lib64/python2.6/doctest.py", line 1248, in __run + compileflags, 1) in test.globs + File "<doctest membership.txt[68]>", 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 -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/826861 Title: doctests failing on Centos 6 due to "unprintable" error objects To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/826861/+subscriptions
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... -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/826861 Title: doctests failing on Centos 6 due to "unprintable" error objects To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/826861/+subscriptions
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... -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/826861 Title: doctests failing on Centos 6 due to "unprintable" error objects To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/826861/+subscriptions
Since recent code changes another test is failing in this way on Centos 6: src/mailman/model/docs/registration.txt File "/home/sgoss/mailman_clone/src/mailman/model/docs/registration.txt", line 61, in registration.txt Failed example: registrar.register(mlist, '\xa0@example.com') Differences (ndiff with -expected +actual): Traceback (most recent call last): - ... - InvalidEmailAddressError: \xa0@example.com + File "/usr/lib64/python2.6/doctest.py", line 1248, in __run + compileflags, 1) in test.globs + File "<doctest registration.txt[11]>", line 1, in <module> + registrar.register(mlist, '\xa0@example.com') + 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> -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/826861 Title: doctests failing on Centos 6 due to "unprintable" error objects To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/826861/+subscriptions
** Changed in: mailman Status: New => Triaged ** Changed in: mailman Importance: Undecided => High -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/826861 Title: doctests failing on Centos 6 due to "unprintable" error objects To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/826861/+subscriptions
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 -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/826861 Title: doctests failing on Centos 6 due to "unprintable" error objects To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/826861/+subscriptions
This bug has been moved to the new gitlab repo here: https://gitlab.com/maxking/mailman/issues/6 -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/826861 Title: doctests failing on Centos 6 due to "unprintable" error objects To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/826861/+subscriptions
Please ignore the above comment, the bug has been moved here: https://gitlab.com/mailman/mailman/issues/6 -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/826861 Title: doctests failing on Centos 6 due to "unprintable" error objects To manage notifications about this bug go to: https://bugs.launchpad.net/mailman/+bug/826861/+subscriptions
participants (3)
-
Abhilash Raj
-
Barry Warsaw
-
Stephen A. Goss