Set LC_ALL-C and run the test suite and around 4 tests fall over.
In latest 0.59.0, not yet checked prior versions but almost definitely will be the same.
Test suite and package requires robustness to manage either type. | |
| priority | normal |
|---|---|
| type | bug |
| appeared in | <not specified> |
| done in | 0.60.0 |
| load | 0.100 |
| load left | 0.000 |
| closed by | #1542:f5f47cc61213 |


#119965 accidental(?) syntax inconsistency in registry.py
Comments
diff -ur logilab-common-0.59.0.orig/test/unittest_umessage.py logilab-common-0.59.0/test/unittest_umessage.py
--- test/unittest_umessage.py 2013-01-24 01:42:03.000000000 +0800
+++ test/unittest_umessage.py 2013-02-10 00:53:58.431767641 +0800
@@ -21,16 +21,17 @@
from logilab.common.testlib import TestCase, unittest_main
from logilab.common.umessage import UMessage, decode_QP
+import io
DATA = join(dirname(abspath(__file__)), 'data')
class UMessageTC(TestCase):
def setUp(self):
- msg1 = email.message_from_file(open(join(DATA, 'test1.msg')))
+ msg1 = email.message_from_file(io.open(join(DATA, 'test1.msg'), encoding='utf8'))
self.umessage1 = UMessage(msg1)
- msg2 = email.message_from_file(open(join(DATA, 'test2.msg')))
+ msg2 = email.message_from_file(io.open(join(DATA, 'test2.msg'), encoding='utf8'))
self.umessage2 = UMessage(msg2)
def test_get_subject(self):
apears to make for a fix
Your change actually breaks the test under python2.
yes, I missed. try:
diff -ur logilab-common-0.59.0.orig/test/unittest_umessage.py logilab-common-0.59.0/test/unittest_umessage.py --- test/unittest_umessage.py 2013-01-24 01:42:03.000000000 +0800 +++ test/unittest_umessage.py 2013-02-10 00:53:58.431767641 +0800 @@ -21,15 +21,20 @@ from logilab.common.testlib import TestCase, unittest_main from logilab.common.umessage import UMessage, decode_QP +import sys, io DATA = join(dirname(abspath(__file__)), 'data') class UMessageTC(TestCase): def setUp(self): - msg1 = email.message_from_file(open(join(DATA, 'test1.msg'))) - self.umessage1 = UMessage(msg1) - msg2 = email.message_from_file(open(join(DATA, 'test2.msg'))) + if sys.version_info >= (3, 2): + msg1 = email.message_from_file(io.open(join(DATA, 'test1.msg'), encoding='utf8')) + msg2 = email.message_from_file(io.open(join(DATA, 'test2.msg'), encoding='utf8')) + else: + msg1 = email.message_from_file(open(join(DATA, 'test1.msg'))) + msg2 = email.message_from_file(open(join(DATA, 'test2.msg'))) + self.umessage1 = UMessage(msg1) self.umessage2 = UMessage(msg2) def test_get_subject(self):and I get passes all with LC_ALL=C run them all with 0.59.0-
the formatter in this web page discouteously deletes all the white space in the def setUp(self):, but I am sure you can re-correct them
done