Fixes#3897
@pingou Please kindly help to review :-)
Let's use python-six for this as this is not going to work with py2 and we likely still want to support both.
rebased onto 00ea424fcc62e9b2c7a1dac3a125b3c8ee9c4234
@pingou Thanks for you review, updated.
Commit b0e64c3e fixes this pull-request
Pull-Request has been merged by pingou
Fixes#3897