Message11031

Author stefan.richthofer
Recipients stefan.richthofer, wymannmi, zyasoft
Date 2017-01-20.05:44:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484891053.79.0.207772010627.issue2521@psf.upfronthosting.co.za>
In-reply-to
Content
I think this boils down to faulty Windows-detection in pip/compat:

# windows detection, covers cpython and ironpython
WINDOWS = (sys.platform.startswith("win") or
           (sys.platform == 'cli' and os.name == 'nt'))

I actually wonder how this could have worked on Windows with Jython at all. I see basically three possible solutions:

1) Fix pip to properly detect Windows in Jython-case
2) Let sys.platform be backed by something like PyShadowString in JyNI
3) Adjust PosixModule.geteuid() such taht it also behaves reasonable on Windows

I'd suggest to apply a combination of 1) and 2) or 1) and 3), given that 1) yields the risk of rejection by pip-devs and would take some time in best case, also restricting Jython to use newest pip version.

Regarding 2) see github.com/Stewori/JyNI/blob/master/JyNI-Java/src/JyNI/PyShadowString.java
It would have to be extended such that it also works with startswith.

Regarding 3) we would perform Windows-detection like in PosixModule.uname() and then let PosixModule.geteuid return 
System.getProperty("user.name") or System.getenv("USERNAME") (does it make a difference? Maybe System.getenv("USERNAME") would be more resilient against some faulty launcher.)

Jim: Which would you prefer? Or do you see another option?

Looking forward to forget about issues like this in Jython 3...


P.S. Am I right to think that this issue is a release blocker for Jython 2.7.1?
History
Date User Action Args
2017-01-20 05:44:13stefan.richthofersetmessageid: <1484891053.79.0.207772010627.issue2521@psf.upfronthosting.co.za>
2017-01-20 05:44:13stefan.richthofersetrecipients: + stefan.richthofer, zyasoft, wymannmi
2017-01-20 05:44:13stefan.richthoferlinkissue2521 messages
2017-01-20 05:44:13stefan.richthofercreate