]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Windows returns EINVAL on bogus filenames 375/head
authorKonstantin Zemlyak <zart@zartsoft.ru>
Sun, 28 Sep 2014 15:08:28 +0000 (21:08 +0600)
committerKonstantin Zemlyak <zart@zartsoft.ru>
Sun, 28 Sep 2014 15:08:28 +0000 (21:08 +0600)
Related pull of pyramid_jinja2: https://github.com/Pylons/pyramid_jinja2/pull/94

jinja2/utils.py

index 1045e3f4642a7be376e6c004f6ee79143382df19..cd4d0669c68fd8d17e6cb97bbe3d2506a76533d0 100644 (file)
@@ -150,7 +150,7 @@ def open_if_exists(filename, mode='rb'):
     try:
         return open(filename, mode)
     except IOError as e:
-        if e.errno not in (errno.ENOENT, errno.EISDIR):
+        if e.errno not in (errno.ENOENT, errno.EISDIR, errno.EINVAL):
             raise