From a9e1969712f68f1f94a2710599301203dbccc19a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 24 Apr 2011 11:06:49 -0600 Subject: [PATCH] Fix #769946 (linux.py script crashes with an OS error 39 (directory not empty)) --- src/calibre/linux.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 5c80df20df..d83bba061f 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -149,7 +149,8 @@ class PostInstall: if islinux or isfreebsd: for f in os.listdir('.'): if os.stat(f).st_uid == 0: - os.rmdir(f) if os.path.isdir(f) else os.unlink(f) + import shutil + shutil.rmtree(f) if os.path.isdir(f) else os.unlink(f) if os.stat(config_dir).st_uid == 0: os.rmdir(config_dir)