Skip to content

Commit

Permalink
Also catch ENOTDIR when initializing logdir
Browse files Browse the repository at this point in the history
There is an implementation difference between CPython and Jython. On
CPython, only ENOENT is raised when the directory does not exist
(see posixmodule.c for instance). On Jython, ENOTDIR is raised when
the directory does not exist, and EACCESS is raised when there is
no read access.

This patch also catches ENOTDIR, but not EACCESS. The code flow
ensures that the logdir is created when it does not exist.

Ref tox-dev#326 .
  • Loading branch information
LordGaav committed Apr 27, 2017
1 parent 2b2a51f commit eb07b59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -44,3 +44,4 @@ Josh Smeaton
Paweł Adamczak
Oliver Bestwalter
Selim Belhaouane
Nick Douma
2 changes: 1 addition & 1 deletion tox/session.py
Expand Up @@ -109,7 +109,7 @@ def _initlogpath(self, actionid):
logdir = self.session.config.logdir
try:
l = logdir.listdir("%s-*" % actionid)
except py.error.ENOENT:
except (py.error.ENOENT, py.error.ENOTDIR):
logdir.ensure(dir=1)
l = []
num = len(l)
Expand Down

0 comments on commit eb07b59

Please sign in to comment.