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

[upstream_utils] Can't run on Windows #7603

Open
WispySparks opened this issue Dec 28, 2024 · 5 comments
Open

[upstream_utils] Can't run on Windows #7603

WispySparks opened this issue Dec 28, 2024 · 5 comments

Comments

@WispySparks
Copy link
Contributor

Upstream utils scripts can't be run on windows due to many paths having hardcoded /. Could be fixed by replacing these with os.path.join or os.path.sep.

@Gold856
Copy link
Contributor

Gold856 commented Dec 29, 2024

This is a problem for only a select few scripts that have direct comparisons between raw paths specified by hand, like ./imgui.h and paths created with os.path.join. The two paths will have inconsistencies in terms of slashes, and the comparisons will therefore fail (because they don't match). One solution is to use os.path.join as a kind of "input sanitizer", and preprocess all manually specified paths with os.path.join before passing them to functions.

@auscompgeek
Copy link
Member

It'd be worth fixing these scripts to use pathlib instead.

@calcmogul
Copy link
Member

calcmogul commented Dec 29, 2024

Although pathlib doesn't add pathlib.Path.walk() (an equivalent of os.walk()) until Python 3.12, and we support down to Python 3.9 at the moment. We may have to shim it.

@TheTripleV
Copy link
Member

Path(top).glob("**/*") give you all the files

@auscompgeek
Copy link
Member

os.walk() accepts path-like objects, so it shouldn't be too bad either way.

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

No branches or pull requests

5 participants