From: Konstantin Zemlyak Date: Sun, 28 Sep 2014 15:08:28 +0000 (+0600) Subject: Windows returns EINVAL on bogus filenames X-Git-Tag: 2.8~34^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b74a4f07d42654cb43afbea9b5633fc36b038b2;p=thirdparty%2Fjinja.git Windows returns EINVAL on bogus filenames Related pull of pyramid_jinja2: https://github.com/Pylons/pyramid_jinja2/pull/94 --- diff --git a/jinja2/utils.py b/jinja2/utils.py index 1045e3f4..cd4d0669 100644 --- a/jinja2/utils.py +++ b/jinja2/utils.py @@ -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