workaround for issue http://bugs.python.org/issue16904