Skip to content

fix: wrap formatwarning() to use relative paths - #4441

Open
dws wants to merge 1 commit into
bazel-contrib:mainfrom
dws:relative-formatwarning
Open

dws wants to merge 1 commit into
bazel-contrib:mainfrom
dws:relative-formatwarning

Conversation

@dws

@dws dws commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

To help eliminate nondeterministic output, particularly when remotely executing, we here wrap Python's formatwarning() to cause it to produce paths relative to the current directory as of the launch of the executable.

I'm proposing this here, since I'm not sure whether this change in behavior would be accepted in core Python, since it's intended to help produce deterministic output under remote execution under Bazel. We've been patching this into our rules_python for some time and have not observed any problems with it.

@dws
dws marked this pull request as ready for review November 8, 2026 18:01
@dws
dws requested review from aignas and rickeylev as code owners November 8, 2026 18:01
To help eliminate nondeterministic output, particularly when remotely
executing, we here wrap Python's formatwarning() to cause it to produce
paths relative to the current directory as of the launch of the
executable.
@dws
dws force-pushed the relative-formatwarning branch from 0f67dc5 to f426e99 Compare November 8, 2026 18:55

This branch has not been deployed

No deployments
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.

1 participant