From d36b9650f4d2d375ce06906d4884657cd03d7138 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Fri, 19 Sep 2014 14:41:08 -0700 Subject: [PATCH] Test in file_rename if target directory exists. This is an attempt to give a reasonable error message in cases where we are about to crash. In particular, when android.sdk_path has a path that does not exist, buildozer should provide a hint as to what might have gone wrong. --- buildozer/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildozer/__init__.py b/buildozer/__init__.py index c720d6a..c8c8857 100644 --- a/buildozer/__init__.py +++ b/buildozer/__init__.py @@ -553,6 +553,8 @@ class Buildozer(object): source = join(cwd, source) target = join(cwd, target) self.debug('Rename {0} to {1}'.format(source, target)) + if not os.path.isdir(os.path.dirname(target)): + self.error('Rename {0} to {1} fails becaues {2} is not a directory'.format(source, target, os.path.directory(target))) rename(source, target) def file_copy(self, source, target, cwd=None):