Python 2/3 support for md5 path encoding