Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platform.system is returning cli on Windows #311

Closed
slozier opened this issue Jan 11, 2018 · 4 comments
Closed

platform.system is returning cli on Windows #311

slozier opened this issue Jan 11, 2018 · 4 comments

Comments

@slozier
Copy link
Contributor

slozier commented Jan 11, 2018

platform.system() is returning cli on Windows but Darwin on macOS. My take on it is that it should probably return Windows on Windows.

For:

  • Gives a (non .NET) API which can give OS information
  • Makes it easier to detect macOS vs Linux (both of these have os.name == "posix")

Against:

  • Jython returns the Java runtime information instead of OS information.
@slide
Copy link
Contributor

slide commented Jan 11, 2018

I guess the question would be is there any code that is vital that looks at platform.system() instead of os.name or something?

@slozier
Copy link
Contributor Author

slozier commented Jan 11, 2018

Seems like it's barely used anywhere and as far as I know the fact that it returns cli isn't used in the codebase.

@ihamburglar
Copy link

If it was running on Mono on Ubuntu vs .Net on Windows, would it actually have any way to distinguish?

@slide
Copy link
Contributor

slide commented Jan 21, 2018

@elitest os.name = 'win32' on windows and 'posix' on Linux and macOS. So, we know at the point in platform.py that it checks, we can assume 'cli' means Windows. Linux and macOS have a os.uname implementation, so they will return the expected values.

@slide slide closed this as completed in 50ad7fd Feb 7, 2018
dpmdpm pushed a commit to dpmdpm/ironpython2 that referenced this issue Aug 2, 2018
* Fix IronLanguages#311

Add check for sys.platform == 'cli' and set os to 'Windows'.

* Remove workaround
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants