Browse Source

Merge pull request #2581 from pallets/config-enotdir

silence ENOTDIR when loading config file
pull/2522/merge
David Lord 7 years ago committed by GitHub
parent
commit
40745bb338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      CHANGES
  2. 4
      flask/config.py

8
CHANGES

@ -3,6 +3,7 @@ Flask Changelog
Here you can see the full list of changes between each Flask release.
Version 0.13
------------
@ -114,7 +115,9 @@ Major release, unreleased
depending on ``app.debug``. No handlers are removed, and a handler is only
added if no handlers are already configured. (`#2436`_)
- Blueprint view function name may not contain dots. (`#2450`_)
- The dev server now uses threads by default.
- The dev server now uses threads by default. (`#2529`_)
- Loading config files with ``silent=True`` will ignore ``ENOTDIR``
errors. (`#2581`_)
.. _pallets/meta#24: https://github.com/pallets/meta/issues/24
.. _#1421: https://github.com/pallets/flask/issues/1421
@ -149,6 +152,9 @@ Major release, unreleased
.. _#2430: https://github.com/pallets/flask/pull/2430
.. _#2436: https://github.com/pallets/flask/pull/2436
.. _#2450: https://github.com/pallets/flask/pull/2450
.. _#2529: https://github.com/pallets/flask/pull/2529
.. _#2581: https://github.com/pallets/flask/pull/2581
Version 0.12.3
--------------

4
flask/config.py

@ -129,7 +129,9 @@ class Config(dict):
with open(filename, mode='rb') as config_file:
exec(compile(config_file.read(), filename, 'exec'), d.__dict__)
except IOError as e:
if silent and e.errno in (errno.ENOENT, errno.EISDIR):
if silent and e.errno in (
errno.ENOENT, errno.EISDIR, errno.ENOTDIR
):
return False
e.strerror = 'Unable to load configuration file (%s)' % e.strerror
raise

Loading…
Cancel
Save