-
Notifications
You must be signed in to change notification settings - Fork 110
fix: resolve both sides of relative_to() for Windows 8.3 path compat #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -838,7 +838,7 @@ def _generate_placement_summary(self, distributed_result) -> str: | |
|
|
||
| for placement in distributed_result.placements: | ||
| try: | ||
| rel_path = placement.agents_path.relative_to(self.base_dir.resolve()).as_posix() | ||
| rel_path = placement.agents_path.resolve().relative_to(self.base_dir.resolve()).as_posix() | ||
| except ValueError: | ||
|
Comment on lines
840
to
842
|
||
| rel_path = str(placement.agents_path) | ||
| lines.append(f"{rel_path}") | ||
|
|
@@ -868,7 +868,7 @@ def _generate_distributed_summary(self, distributed_result, config: CompilationC | |
|
|
||
| for placement in distributed_result.placements: | ||
| try: | ||
| rel_path = placement.agents_path.relative_to(self.base_dir.resolve()).as_posix() | ||
| rel_path = placement.agents_path.resolve().relative_to(self.base_dir.resolve()).as_posix() | ||
| except ValueError: | ||
| rel_path = str(placement.agents_path) | ||
| lines.append(f"- {rel_path} ({len(placement.instructions)} instructions)") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.base_dir.resolve()is recomputed for every placement. SincePath.resolve()can hit the filesystem and is relatively expensive on Windows, compute the resolved base dir once before the loop (e.g.,base_dir_resolved = self.base_dir.resolve()) and reuse it for eachrelative_to()call.This issue also appears on line 869 of the same file.