Skip to content
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

Be more flexible on accepted paths #105

Merged
merged 6 commits into from
Nov 4, 2023

Conversation

felixfontein
Copy link
Collaborator

No description provided.

@gotmax23
Copy link
Collaborator

gotmax23 commented Oct 5, 2023

Thanks for cleaning this up! I think we should standardize on StrPath so we can use os.path.join 1 and others and not have to worry about converting between str and bytes. It's confusing if some but not all functions support bytes paths.

Footnotes

  1. If one argument to os.path.join is bytes, all the others have to be.

@felixfontein
Copy link
Collaborator Author

Thanks for cleaning this up! I think we should standardize on StrPath so we can use os.path.join 1 and others and not have to worry about converting between str and bytes. It's confusing if some but not all functions support bytes paths.

We already use StrOrBytesPath in multiple places (src/antsibull_core/yaml.py, src/antsibull_core/subprocess_util.py, src/antsibull_core/utils/io.py). At least for hashing I would also use it, since it's very similar to the others. For dependency_files I don't mind switching to StrPath (I'll push a commit for that soon).

src/antsibull_core/config.py Outdated Show resolved Hide resolved
src/antsibull_core/filesystem.py Outdated Show resolved Hide resolved
src/antsibull_core/filesystem.py Outdated Show resolved Hide resolved
src/antsibull_core/tarball.py Outdated Show resolved Hide resolved
@gotmax23 gotmax23 closed this Oct 10, 2023
@gotmax23 gotmax23 reopened this Oct 10, 2023
@felixfontein felixfontein merged commit 580708d into ansible-community:main Nov 4, 2023
4 of 5 checks passed
@felixfontein felixfontein deleted the path branch November 4, 2023 11:05
@felixfontein
Copy link
Collaborator Author

@gotmax23 thanks for reviewing this!

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.

2 participants