Skip to content

Commit

Permalink
Fix galaxy.util.in_directory() - broken because it takes realpath of …
Browse files Browse the repository at this point in the history
…just one argument.

Easy to see on Mac OS X since /tmp isn't really /tmp for instance:

```
% touch /tmp/moo
% python
>>> import galaxy.util
>>> galaxy.util.in_directory("/tmp/moo", "/tmp/moo")
False
```

... and this is why the Travis tests are failing under Mac OS X. Broken with 93a8bfc.
  • Loading branch information
jmchilton committed Oct 25, 2017
1 parent a4a8f15 commit 899b0d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/galaxy/util/path/__init__.py
Expand Up @@ -119,7 +119,7 @@ def __walk(path):

def __contains(prefix, path, whitelist=None):
real = realpath(join(prefix, path))
yield not relpath(real, prefix).startswith(pardir)
yield not relpath(real, realpath(prefix)).startswith(pardir)
for wldir in whitelist or []:
yield not relpath(real, wldir).startswith(pardir)

Expand Down

0 comments on commit 899b0d8

Please sign in to comment.