Repository navigation
Isolate the current directory when probing gitfame for the author - #70
Conversation
450d03b to
3ad2784
Compare
Let's not make this change; it adds lots of conditionality to the implementation that I'd like to avoid. |
Without an explicit safe path, a project module shadowing one of gitfame's stdlib imports (e.g. a top-level logging.py) breaks author discovery, and PYTHONSAFEPATH alone doesn't cover Python 3.10. Closes #69 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
3ad2784 to
4aefeed
Compare
|
Agreed, and dropped — the branch is amended ( For the record, there was no strong motivation to keep it:
What's given up is only the legibility of the symptom — an unresolvable author again surfaces as |
Closes #69.
author_from_vcs()spawned gitfame from the project directory with no protection against the cwd shadowing the stdlib. In coherent's flat layout that's a live hazard: a project with a top-levellogging.py(e.g. compilers.common) makes gitfame'simport loggingresolve to the project module, gitfame produces no author, and the build later dies inMessage.parse_contributor.Now the probe runs via
jaraco.compat.py310.safe_path, released as 4.4.0 for this purpose:safe_path.command(...)prefixessys.executableand, below 3.11,-I.safe_path.environ()setsPYTHONSAFEPATH=1unconditionally.That keeps the isolation self-supplied rather than depending on the caller's environment, and it covers 3.10, where
PYTHONSAFEPATHis a silent no-op — the reason the reusable workflow'sPYTHONSAFEPATH: '1'masked this everywhere except the 3.10 matrix leg. coherent.deps moves onto the same shared shim in coherent-oss/coherent.deps#24, replacing its local copy.tests/test_discovery.pybuilds a throwaway git repo carrying a shadowinglogging.pyand asserts the author resolves. Verified it fails without the fix (author_from_vcs()returnsNone, the precondition for the reported crash) and passes with it.🤖 Generated with Claude Code