Catch import errors thrown by os.path.expanduser(); issue #297

* This can happen particularly with AppEngine when importing pwd