Author stefan.richthofer
Recipients stefan.richthofer
Date 2017-02-22.03:50:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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\", 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 (, 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.
Date User Action Args
2017-02-22 03:50:44stefan.richthofersetrecipients: + stefan.richthofer
2017-02-22 03:50:44stefan.richthofersetmessageid: <>
2017-02-22 03:50:44stefan.richthoferlinkissue2553 messages
2017-02-22 03:50:43stefan.richthofercreate