Skip to content

[Bug]: Incorrect graalpy exit code when a script is passed via stdin #680

@gershnik

Description

@gershnik

Describe the bug

graalpy returns 0 exit code when a script that does sys.ext(<non-zero>) is passed via stdin.
It works correctly when the same script is passed via -c

Operating system

macOS

CPU architecture

ARM64

GraalPy version

GraalPy 3.12.8 (Oracle GraalVM Native 25.0.2)

JDK version

No response

Context configuration

No response

Steps to reproduce

% graalpy <<'EOF'
import sys
sys.exit(42)
EOF
echo $?
0

or

>>> script='''
... import sys
... sys.exit(42)
... '''
>>> result = subprocess.run([sys.executable], input=script, encoding='utf-8')
>>> print(result.returncode)
0

Expected behavior

Non-zero exit code (42 in the example above) should be returned

Stack trace

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions