reduces performance on python 2.7, but that is ok also fixes `unknown encoding: idna` due to cpython race