Skip to content

test: GraalPy's 'from m import *' swallows a missing __all__ name, failing the aenum premise test #2083

Closed

Description

@JarryShaw

Split from #2082. tests/utilities/test_compat_aenum_nonetype_1958_unit.py::TheAenumPremiseTests::test_aenum_alone_fails_on_the_builtin has failed on every full GraalPy run since #2006. It gets NameError: name '_Addendum' is not defined at aenum/_constant.py:107, where the test expects AttributeError.

Cause (from GraalPy's source, not reproduced locally): in oracle/graalpython's ImportStarNode.java, a single catch (PException e) { e.expectAttributeError(...) } handles both "no __all__" and "a name in __all__ is missing". On a missing name, GraalPy falls back to the module dict, which skips _ names. CPython raises AttributeError instead.

Repro: m.py holds __all__ = ['a', 'missing', '_b']; a = 1; _b = 2, and from m import * raises AttributeError on CPython but should give NameError: _b on GraalPy. No upstream issue was found.

Next: gate the premise test on GraalPy with a reason that cites the upstream behaviour (third-party runtimes are best effort). Reporting it upstream is the owner's call.

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    testPull requests that add or correct tests (test: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 23, 2026
  2. moved this to Pending in PyPCAPKiton Oct 23, 2026
  3. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 23, 2026
  4. moved this from Pending to WIP in PyPCAPKiton Oct 23, 2026
  5. JarryShaw commented on Oct 23, 2026

    @JarryShaw
    OwnerAuthor

    Fixed in b561d0f, a test-only push to main. On GraalPy, TheAenumPremiseTests now asserts the NameError on _Addendum that GraalPy actually raises. Everywhere else it still asserts CPython's AttributeError. The comment cites ImportStarNode.doImport: there, the per-name getAttr for each __all__ entry sits inside the same try as the __all__ lookup, so a missing name falls into the module-dict fallback, which skips _ names. If GraalPy is fixed, the assertion fails and tells us. The fix was checked on a real GraalPy 25.4.4 (1 failed before, 1 passed after) and on CPython 3.14.9.

  6. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 23, 2026
  7. added this to the PyPCAPKit v1.5 milestone on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)testPull requests that add or correct tests (test: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions