2a4d979 Workaround for wrong order of repr on s390x

Authored and Committed by lslebodn 5 years ago
1 file changed. 2 lines added. 0 lines removed.
    Workaround for wrong order of repr on s390x
    
    The standard dictionary in Python 3.7 is ordered
    But it can fail with python2
    
    Simple reproducer:
    for i in {1..10}; do PYTHONHASHSEED=random python2 -c 'import ldb; msg = ldb.Message(); msg.dn = ldb.Dn(ldb.Ldb(), "dc=foo29"); msg["dc"] = b"foo"; print(repr(msg)) '; done
    
    ======================================================================
    FAIL: test_repr (__main__.LdbMsgTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "tests/python/api.py", line 2322, in test_repr
        "Message({'dn': Dn('dc=foo29'), 'dc': MessageElement(['foo'])})")
    AssertionError: "Message({'dc': MessageElement(['foo']), 'dn': Dn('dc=foo29')})" != "Message({'dn': Dn('dc=foo29'), 'dc': MessageElement(['foo'])})"
    ----------------------------------------------------------------------
    Ran 1025 tests in 29.146s
    FAILED (failures=1)
    
        
file modified
+2 -0