From 08165fcfdcfcd19095d2223677b7229e8c98d57f Mon Sep 17 00:00:00 2001 From: Brandon Rhodes Date: Tue, 27 Aug 2019 15:46:41 -0400 Subject: [PATCH] Only error if directory really does not exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, a user is getting an error from makedirs() with the argument of the current directory '.'. Per the comments in a more recent `os.py` let’s refuse to error out if the directory exists. Hopefully, fix #283. --- skyfield/iokit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skyfield/iokit.py b/skyfield/iokit.py index 1cb176f9e..b91399e73 100644 --- a/skyfield/iokit.py +++ b/skyfield/iokit.py @@ -97,7 +97,7 @@ def __init__(self, directory, verbose=True, expire=True): try: os.makedirs(self.directory) except OSError as e: - if e.errno != errno.EEXIST: + if e.errno != errno.EEXIST and not os.path.isdir(name): raise # Each instance gets its own copy of these data structures,