Issue2145

classification
Title: os.stat() missing from Jython on Windows
Type: Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, jeff.allen, pjenvey, zyasoft
Priority: high Keywords:

Created on 2014-05-15.22:35:26 by jeff.allen, last changed 2014-05-18.09:11:11 by jeff.allen.

Messages
msg8413 (view) Author: Jeff Allen (jeff.allen) Date: 2014-05-15.22:35:26
Since the upgrade to jnr-posix-3.0.1 (in change set #01460e803ef3) Jython no longer runs on Windows.

>dist\bin\jython -S
Jython 2.7b2+ (default:01460e803ef3+, May 15 2014, 22:23:42)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_51
>>> import os
>>> os.stat("macbeth.txt")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NotImplementedError: stat

Without the -S, it just (Python) stack dumps during site.py.

I've traced my way into jnr.posix.WindowsPOSIX.stat, but at the point where it accesses the native code (interface jnr.posix.WindowsLibC) it gets UnsatisfiedLinkError. It's perhaps more surprising that it used to work.

Seems like this would be a showstopper for 2.7b3.
msg8422 (view) Author: Philip Jenvey (pjenvey) Date: 2014-05-16.17:41:34
What version of Windows? Do you have a full stacktrace for the UnsatisfiedLinkError? IIRC you can increase jython's command line verbosity flag and the PythonPOSIXHandler will show a stacktrace in this situation
msg8424 (view) Author: Jeff Allen (jeff.allen) Date: 2014-05-16.19:15:22
Windows 7. I know where the exception is raised, but I think the root cause is more likely where the "provider" is chosen. I'll step carefully through both versions and add a note here of what I find. Reversing out the change was suggested, but I'd like to look for a simple fix in "forward gear", for a few hours.
msg8425 (view) Author: Jim Baker (zyasoft) Date: 2014-05-17.20:10:21
Jeff, thanks for taking a look. I'm currently flying and cannot pull to my Windows 8.1 VM despite otherwise working in-flight WiFi, but hopefully we can figure this out soon.

I've talked with Frank and we are holding beta 3 until we have some resolution on this one way or the other.
msg8435 (view) Author: Jim Baker (zyasoft) Date: 2014-05-18.03:13:32
Backed out the changeset that was causing the issue (the hg backout subcommand is very convenient), specifically the upgrade of the JNR and JFFI jars. See #2110 for more details.

We will want to upgrade, but we shouldn't have trunk break in the interim. This also unblocks beta 3.
msg8436 (view) Author: Jeff Allen (jeff.allen) Date: 2014-05-18.09:11:11
This seems to be a problem either with jnr-posix, or with jnr-ffi. I have filed an analysis at https://github.com/jnr/jnr-posix/issues/25 .

That seems to offer the possibility we could fall back to a Java implementation for Windows until its properly resolved, but I'll work with the backed-out version for now.
History
Date User Action Args
2014-05-18 09:11:11jeff.allensetmessages: + msg8436
2014-05-18 03:13:32zyasoftsetstatus: open -> closed
resolution: fixed
messages: + msg8435
2014-05-17 20:10:22zyasoftsetnosy: + fwierzbicki, zyasoft
messages: + msg8425
2014-05-16 19:15:22jeff.allensetmessages: + msg8424
2014-05-16 17:41:34pjenveysetnosy: + pjenvey
messages: + msg8422
2014-05-15 22:35:26jeff.allencreate