Skip to content

Conversation

@gvanrossum
Copy link
Member

@gvanrossumgvanrossum commented Jul 20, 2023

This restores a corner case: when the generator is run with working directory set to Tools/cases_generator, the source filenames listed in the generated provenance header should be relative to the repo root directory.

deffrom_source_files(self) ->str:
paths=f"\n{self.out.comment} ".join(
prettify_filename(filename)
prettify_filename(os.path.relpath(filename, ROOT))
Copy link
Member

Choose a reason for hiding this comment

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

Tests fail again with ValueError: path is on mount 'C:', start on mount 'D:' because of tempdir location.

I think we can solve this by using something like:

try: filename=os.path.relpath(filename, ROOT)) exceptValueError: # This can happen if `filename` and `ROOT` are on different disks on Win:pass

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Thanks! Will do.

@gvanrossumgvanrossum merged commit 1218910 into python:mainJul 20, 2023
@gvanrossumgvanrossum deleted the add-relpath branch July 20, 2023 23:29
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@gvanrossum@sobolevn@bedevere-bot