universal POSIX compatibility
Py2 and Py3 compatibility