possible win32 support (largely lifted from cpython). untested atm