Skip to content
Myr

silence ENOTDIR when loading config file

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent 26f413e · Browse files · 2 files+10 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−2 removed

  • other:+10 added−2 removed

2 files+10 added−2 removed

modified:flask/config.py+3 added-1 removed
127 unmodified lines
128 try:129 with open(filename, mode='rb') as config_file:130 exec(compile(config_file.read(), filename, 'exec'), d.__dict__)131 except IOError as e:132 if silent and e.errno in (errno.ENOENT, errno.EISDIR):132 if silent and e.errno in (133 errno.ENOENT, errno.EISDIR, errno.ENOTDIR134 ):135 return False136 e.strerror = 'Unable to load configuration file (%s)' % e.strerror137 raise138 self.from_object(d)
127 unmodified lines
modified:CHANGES+7 added-1 removed
1 unmodified line
2===============34Here you can see the full list of changes between each Flask release.567Version 0.138------------910Major release, unreleased
103 unmodified lines
114 ``app.debug`` each time. Only one format is used, not different ones115 depending on ``app.debug``. No handlers are removed, and a handler is only116 added if no handlers are already configured. (`#2436`_)117- Blueprint view function name may not contain dots. (`#2450`_)117- The dev server now uses threads by default.118- The dev server now uses threads by default. (`#2529`_)119- Loading config files with ``silent=True`` will ignore ``ENOTDIR``120 errors. (`#2581`_)121122.. _pallets/meta#24: https://github.com/pallets/meta/issues/24123.. _#1421: https://github.com/pallets/flask/issues/1421124.. _#1489: https://github.com/pallets/flask/pull/1489
26 unmodified lines
151.. _#2416: https://github.com/pallets/flask/pull/2416152.. _#2430: https://github.com/pallets/flask/pull/2430153.. _#2436: https://github.com/pallets/flask/pull/2436154.. _#2450: https://github.com/pallets/flask/pull/2450155.. _#2529: https://github.com/pallets/flask/pull/2529156.. _#2581: https://github.com/pallets/flask/pull/2581157158159Version 0.12.3160--------------161162Bugfix release, unreleased
624 unmodified lines