GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — bpo-29546: Set path on ImportError for from ... import by Carreau · Pull Request #91 · python/cpython Conversation
Contributor
And See bpo-29546 This is a step toward providing better error messages in case of cannot import name {name} from {module} ({path}) But that's probably going to trigger more discussions that filling in I'm not familiar with C-internal of CPython, So let me know if I'm doing things wrong.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
brettcannon
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like there's a missing space between the final
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dang. Fixed.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Carreau
force-pushed
the
betterimport
branch
from
bd14cf2 to
d3aff79
Compare
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
brettcannon
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a test.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
brettcannon
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't include docstrings on tests (and we PEP 8 doesn't allow starting a docstring with a newline).
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you do an
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The custom message isn't necessary as what the test is checking is obvious (same goes for all of the other messages).
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason you can't use
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just forgot you could access the exception after the fact with
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary blank line.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Carreau
force-pushed
the
betterimport
branch
2 times, most recently
from
3f218f5 to
30a5055
Compare
brettcannon
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo" cannonical" -> "canonical"
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need to find a linter that understand both programming and english.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should there be a test for
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could, but that's taken care of by functions above. Here I'm just checking that it's not
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a comment like
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Too early in the bootstrap process ?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Carreau
force-pushed
the
betterimport
branch
from
30a5055 to
32e42aa
Compare
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. And `path` as well when existing.
See bpo-29546
This is a step toward providing better error messages in case of
from-import. Barry Warsaw Proposed:
cannot import name {name} from {module} ({path})
But that's probably going to trigger more discussions that filling in
already existing fields.
Make sure they name and path are set in various case.
Carreau
force-pushed
the
betterimport
branch
from
32e42aa to
7456cfc
Compare
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
brettcannon
approved these changes
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Merged! Thanks again! And I'm glad that the new workflow worked out for you! As for me, the new workflow let me review this PR throughout the day when I had time and do it entirely in the browser so I didn't have to remember to commit it when I got home (if I had to cherry-pick that would not have been the case, but I could at least merge now and cherry-pick later if need be). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Hopping you will get the cherry-pick bot soon. Thanks for the time you've put into this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Carreau the bot would be great, but at worst me or someone else can write a Python script probably to automate it locally if necessary (which reminds me, I should write that idea down over on core-workflow). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
You did python/core-workflow#8 (Bot to automatically generate cherry-picking PRs) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Wow, I'm very pleasantly impressed at how quickly my bug/idea went to (nearly) implemented through the new workflow. Kudos! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Happy to repay a bit for all the work you did. It's also much easier to decide to implement if a core dev have pitched in the idea, as it has more chance to be accepted. Thanks both ! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add location information like canonical module name where identifier cannot be found and file location if available. First iteration of this was pythongh-91
…ursion depth Reset the recursion depth in PyTasklet_BindEx and add a few asserts. This fixes issue python#91. Add a test case for the recursion depth and as test case for an assertion failure caused by this bug. https://bitbucket.org/stackless-dev/stackless/issues/91 (grafted from 1584a89fca366f66dadf3cf04f0306dd45b1372f and 380b70b1933d)
Implements scripts/w45_bridge_drift_falsifier.sh per docs/w45-bridge-signature-drift-falsifier.md. Mutate-Build-Verify-Restore loop: - Mutates a bridge signature (extern "C" decl in builder.cpp + function definition in builder_emit_c.c, in lockstep) by appending a sentinel param 'int phx_w45_drift'. - Verifies the build fails at the C++ dispatch-switch call site (which has the OLD arity). - Restores both files; clean rebuild verifies tree state. Catches the structural drift class identified by pythia python#90/python#91: void* args at the bridge crossing erase the type-safety C++ overload resolution would normally provide. 252+ dispatch sites in builder.cpp post Phase 1 burndown — manual audit unscalable. Initial 6 fixtures (per spec §2.2 + §2.6 retro): - hir_builder_emit_before_with_c (Phase 1 python#6 retro) - hir_builder_emit_setup_with_c (Phase 1 python#7 retro) - hir_builder_emit_format_simple_c (Phase 1 python#2 sample) - hir_builder_emit_copy_free_vars_c (Phase 1 python#4 sample) - hir_builder_emit_get_yield_from_iter_c (Phase 1 python#4 sample) - hir_builder_emit_primitive_load_const_c (Phase 1 python#5 sample) Modes: - --dry-run: stage mutations, no build (any agent — bypass build lock) - --strict: exit 1 on FAIL (for gate integration) - --verbose: show build stderr Uses perl -0777 multi-line slurp for robust parsing of multi-line extern decls + function definitions. Mutation marker (phx_w45_drift) verified post-mutation to guard against silent no-op substitutions. Build lock: BUILD mode invokes cmake --build --target jit; per CLAUDE.md Phase 3D Build Lock, only testkeeper / gate_phoenix.sh may invoke with builds enabled. --dry-run is unrestricted. Authorization: theologian 21:55:24Z + supervisor 21:55:36Z + 22:33:17Z DISPOSITION (C). §3.5 fold-into-C derivation falsifier (opcode-constant shadow class) is deferred — needs W21 golden integration. Sibling workstreams: W33 (zero-bridge verifier), W42 (refcount correctness), W44 (DO-NOT-USE caller gate).
Per testkeeper 22:44:12Z STRICT VERIFY: BUILD MODE was running 'cmake --build .' from REPO_ROOT, but cmake build dir is Python/jit_build/build. All 6 fixtures errored with "not a CMake build directory" → counted as FAIL → false GATE FAIL. Fix: introduce CMAKE_BUILD_DIR variable + pass to both cmake calls (per-fixture build at L153, post-restore rebuild at L194). Concept already EMPIRICALLY VERIFIED by testkeeper manual sanity-test on hir_builder_emit_format_simple_c — build failed at builder.cpp:2492 with "no matching function" + "candidate function not viable: requires 4 arguments, but 3 were provided". Exact void*-arg-erasure detection pythia python#90/python#91 named. Post-fix expected: 6/6 PASS in BUILD MODE.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.