Issue2553
Created on 2017-02-22.03:50:44 by stefan.richthofer, last changed 2017-03-28.05:27:20 by zyasoft.
msg11109 (view) |
Author: Stefan Richthofer (stefan.richthofer) |
Date: 2017-02-22.03:50:43 |
|
Jython 2.7.1b3
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_121
Type "help", "copyright", "credits" or "license" for more information.
>>> import pathlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\workspace\linux\Jython\installer_test\2.7.1\Lib\site-packages\pathlib.py", line 36, in <module>
if sys.getwindowsversion()[:2] >= (6, 0) and sys.version_info >= (3, 2):
AttributeError: '<reflected field public org.python.core.PyObject o' object has no attribute 'getwindowsversion'
>>> exit()
Tested on Windows 10 using Java 8 + current Jython trunk version.
I think it is feasible with minor effort to implement a rudimentary fake-variant of getwindowsversion (leaving out the servicepack entry).
Looking into CPython source, it turns out getwindowsversion is backed by the Windows library function GetVersionEx.
According to GetVersionEx doc (https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx), GetVersionEx is somewhat deprecated and reports version 6.2 even for Windows > 6.2.
We could do an actual call to GetVersionEx via JNR, but I would rather just fake it based on what I already did in os.uname and platform.uname implementation. Should be sufficient for most use-cases, in particular also for pathlib.
|
msg11121 (view) |
Author: Stefan Richthofer (stefan.richthofer) |
Date: 2017-02-24.10:55:22 |
|
Fixed as of https://hg.python.org/jython/rev/9eac49911e8f.
|
|
Date |
User |
Action |
Args |
2017-03-28 05:27:20 | zyasoft | set | status: pending -> closed |
2017-02-24 10:55:23 | stefan.richthofer | set | status: open -> pending versions:
+ Jython 2.7 resolution: fixed messages:
+ msg11121 milestone: Jython 2.7.1 type: behaviour |
2017-02-22 03:50:44 | stefan.richthofer | create | |
|