From b287e3d1cfcfd99104077d15c5b2bc5c249a99d6 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 10 Nov 2007 20:07:15 +0000 Subject: [PATCH] Better error message when the target directory does not exist. git-svn-id: file:///home/talex/Backups/sf.net/Subversion/zero-install/trunk/0publish@2074 9f8c893c-44ee-0310-b757-c8ca8341c71e --- signing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/signing.py b/signing.py index 5ff89e9..77b4012 100644 --- a/signing.py +++ b/signing.py @@ -31,7 +31,9 @@ def check_signature(path): def write_tmp(path, data): """Create a temporary file in the same directory as 'path' and write data to it.""" - fd, tmp = tempfile.mkstemp(prefix = 'tmp-', dir = os.path.dirname(path)) + tmpdir = os.path.dirname(path) + assert os.path.isdir(tmpdir), "Not a directory: " + tmpdir + fd, tmp = tempfile.mkstemp(prefix = 'tmp-', dir = tmpdir) stream = os.fdopen(fd, 'w') stream.write(data) stream.close() -- 2.11.4.GIT