graalpython icon indicating copy to clipboard operation
graalpython copied to clipboard

`platform.system()` returns `linux` when it should return `Linux`

Open Thihup opened this issue 8 months ago • 1 comments

Thihup avatar Mar 28 '25 15:03 Thihup

EmulatedPosixSupport.java:

@ExportMessage
    public Object[] uname(@Shared("js2ts") @Cached TruffleString.FromJavaStringNode fromJavaStringNode) {
        return new Object[]{PythonOS.getPythonOS().getName(), fromJavaStringNode.execute(getHostName(this.withoutIOSocket), PythonUtils.TS_ENCODING), fromJavaStringNode.execute(getOsVersion(), PythonUtils.TS_ENCODING), StringLiterals.T_EMPTY_STRING, PythonUtils.getPythonArch()};
    }

PythonOS

public enum PythonOS {
   ...
   PLATFORM_LINUX("linux"),
   ...
}

It seems to be returning lowercase instead of "Linux"

Thihup avatar Mar 28 '25 17:03 Thihup