Commit 3c2782d
Use PurePosixPath for cross-platform path handling (#15113)
Replace string split("/") with PurePosixPath().name for extracting
filenames from cloud storage paths, URLs, and HuggingFace repo names.
While these paths use forward slashes by convention (not affected by
the host OS), using PurePosixPath is more explicit, self-documenting,
and follows Python best practices for path manipulation.
Files modified:
- nemo/core/connectors/save_restore_connector.py (cloud storage paths)
- nemo/core/classes/common.py (cloud URLs and HuggingFace repo names)
Note: tarutils.py and nemo_file.py were NOT modified as they handle
tar archive internal paths (which mandate POSIX format) and dictionary
keys (not filesystem paths) respectively.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: yurekami <[email protected]>1 parent 1a3c291 commit 3c2782d
File tree
2 files changed
+10
-5
lines changed- nemo/core
- classes
- connectors
2 files changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | | - | |
| 937 | + | |
| 938 | + | |
938 | 939 | | |
939 | 940 | | |
940 | 941 | | |
| |||
972 | 973 | | |
973 | 974 | | |
974 | 975 | | |
975 | | - | |
| 976 | + | |
| 977 | + | |
976 | 978 | | |
977 | 979 | | |
978 | 980 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
613 | | - | |
| 614 | + | |
| 615 | + | |
614 | 616 | | |
615 | 617 | | |
616 | 618 | | |
| |||
726 | 728 | | |
727 | 729 | | |
728 | 730 | | |
729 | | - | |
| 731 | + | |
| 732 | + | |
730 | 733 | | |
731 | 734 | | |
732 | 735 | | |
| |||
0 commit comments