Fixing bug caused by Python's odd pwd policies