I cannot reproduce this even with python-m2crypto in Debian/stretch (that's 0.24.0 from 2016-03-21). The last version where I could reproduce it is on my RHEL-7 (0.21.1 from 2011-01- 15).
If you can reproduce the bug with version of M2Crypto more recent than the last year, I would be interested in the bug report upstream (https://gitlab.com/m2crypto/m2crypto/issues/new ). Thank you, Matěj