gh-140633: AppleFrameworkLoader: Ignore AttributeError when setting __file__#140635
Conversation
|
!buildbot iOS |
|
🤖 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: The builders matched are:
|
freakboy3742
left a comment
There was a problem hiding this comment.
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.
|
@encukou One additional thought - Is this behavior a new feature of 3.15, or does this require back porting to 3.14/13? |
|
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. |
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…ting __file__ (pythonGH-140635) (cherry picked from commit 3416e7c) Co-authored-by: Petr Viktorin <encukou@gmail.com>
…ting __file__ (pythonGH-140635) (cherry picked from commit 3416e7c) Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
GH-140659 is a backport of this pull request to the 3.13 branch. |
|
GH-140660 is a backport of this pull request to the 3.14 branch. |
__file__#140633