2012/10/8 Wayne Thomson <
wayne....@wayju.com>:
> Thanks Pekka.
>
> In jython os.listdir returns the folder contents but os.path.isdir returns
> False.
> In python os.listdir returns the folder contents and os.path.isdir returns
> True.
Sounds like there is some kind of a weird bug in Jython.
> I guess this points to the direction of the problem. I am currently running
> python 2.7.2 and jython 2.5.1. I could try different jython versions when at
> work tomorrow, though I was pretty sure that my colleague and I had the same
> versions.
Did you find any more information regarding to this? If not, below are
few more questions that might help us to understand what's going on:
- Does your path contain non-ASCII characters?
- When using Jython directly, did you use Unicode or byte string (i.e.
u'path' or 'path')?
- Does os.path.exist(path) work with Jython?
- What does os.stat(path) return?
Because it seems that os.listdir itself works and the problem is in
os.path.isdir, we could consider changing List Directory keyword to
just use the former without verifying that the directory actually
exists before. That would cause slightly worse error messages with
non-existing directories, but that's pretty minor problem compared to
the whole keyword not working. It would be much better to understand
the actual root cause and possibly fix or workaround it, though,
because in the current situation many other OperatingSystem keywords
(e.g. Directory Should Exist) will not work for you anyway.
Cheers,
.peke