From 466f73159e0b9dfda3443350d0701ba4a60c449f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 15 Jan 2012 10:16:24 +0530 Subject: [PATCH] If calibre is atrted from a directory that does not exist, automatically use the home directory as the working directory, instead of crashing --- src/calibre/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/__init__.py b/src/calibre/__init__.py index f17b909ea7..82c2519e29 100644 --- a/src/calibre/__init__.py +++ b/src/calibre/__init__.py @@ -10,7 +10,10 @@ from math import floor from functools import partial warnings.simplefilter('ignore', DeprecationWarning) - +try: + os.getcwdu() +except: + os.chdir(os.path.expanduser('~')) from calibre.constants import (iswindows, isosx, islinux, isfrozen, isbsd, preferred_encoding, __appname__, __version__, __author__,