Skip to content
Snippets Groups Projects
Commit f28c6497 authored by Alessandro Cerioni's avatar Alessandro Cerioni
Browse files

Make sure the working directory exists before trying to write inside.

parent 7ecb884e
No related branches found
No related tags found
No related merge requests found
......@@ -151,6 +151,8 @@ def get_capabilities( root_url, service, working_directory ):
if file_found == False or age > 86400:
logging.info('Fetching a new file...')
res = requests.get(url)
if not os.path.exists(working_directory):
os.makedirs(working_directory)
with codecs.open(filename, 'w', 'utf-8') as fp:
#fp.write(res.text.encode("utf-8"))
fp.write(res.text)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment