several tests are failing on core when using py3. these commits adapts the tests to passes on py2 and py3.