Skip to content

Commit

Permalink
[app.py] silently absorb ENOTDIR IOErrors when trying configfile paths.
Browse files Browse the repository at this point in the history
  Fixes issue #252
  • Loading branch information
init-js authored and joeyespo committed Jun 17, 2019
1 parent a2a44cf commit a1efa11
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions grip/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import sys
import threading
import time
import errno
from traceback import format_exc
try:
from urlparse import urlparse
Expand Down Expand Up @@ -71,9 +72,19 @@ def __init__(self, source=None, auth=None, renderer=None,
__name__, static_url_path=static_url_path,
instance_path=instance_path, **kwargs)
self.config.from_object('grip.settings')
self.config.from_pyfile('settings_local.py', silent=True)
self.config.from_pyfile(
os.path.join(instance_path, 'settings.py'), silent=True)

try:
self.config.from_pyfile('settings_local.py', silent=True)
self.config.from_pyfile(
os.path.join(instance_path, 'settings.py'), silent=True)
except IOError as ex:
# workaround for pre-existing ~/.grip regular file from
# the cd-rom tool, and flask not silently ignoring those
if ex.errno in (errno.ENOTDIR,):
pass
else:
raise


# Defaults from settings
if autorefresh is None:
Expand Down

0 comments on commit a1efa11

Please sign in to comment.
  NODES
COMMUNITY 1
Note 1
Project 3
USERS 1