Skip to content

Conversation

@encukou
Copy link
Member

@encukou encukou commented Oct 26, 2025

@freakboy3742
Copy link
Contributor

!buildbot iOS

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 727bfa1 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F140635%2Fmerge

The command will test the builders whose names match following regular expression: iOS

The builders matched are:

  • iOS ARM64 Simulator PR

Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I fully follow the scenario where this would happen in practice (i.e., under what practical circumstances would Py_mod_create return an immutable non-module object?) - but if the object doesn't have a __file__, this seems like a reasonable (and consistent) response. __file__ isn't needed at runtime for the Apple Framework loader to operate; and it's passing CI with this change - so I guess it's OK to merge.

@freakboy3742
Copy link
Contributor

@encukou One additional thought - Is this behavior a new feature of 3.15, or does this require back porting to 3.14/13?

@encukou
Copy link
Member Author

encukou commented Oct 27, 2025

I agree it's not immediately practical.

(What is sometimes practical is non-module objects in general. While implementing PEP 793 and testing the edge cases, I used a string to keep the test simple. Guess strings are too simple!)

The behaviour is not new. I don't think it requires backporting, but it's probably better to file off an obscure sharp edge.

@encukou encukou merged commit 3416e7c into python:main Oct 27, 2025
52 checks passed
@encukou encukou deleted the appleframeworkloader-attributeerror branch October 27, 2025 09:22
@encukou encukou added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Oct 27, 2025
@miss-islington-app
Copy link

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 27, 2025
…ting __file__ (pythonGH-140635)

(cherry picked from commit 3416e7c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 27, 2025
…ting __file__ (pythonGH-140635)

(cherry picked from commit 3416e7c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Oct 27, 2025

GH-140659 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Oct 27, 2025
@bedevere-app
Copy link

bedevere-app bot commented Oct 27, 2025

GH-140660 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Oct 27, 2025
encukou added a commit that referenced this pull request Oct 27, 2025
…tting __file__ (GH-140635) (GH-140660)

(cherry picked from commit 3416e7c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
encukou added a commit that referenced this pull request Oct 27, 2025
…tting __file__ (GH-140635) (GH-140659)

(cherry picked from commit 3416e7c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants