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

get_base_dir returns wrong path with top level directories on windows #52048

Closed
theraot opened this issue Aug 24, 2021 · 1 comment · Fixed by #52049
Closed

get_base_dir returns wrong path with top level directories on windows #52048

theraot opened this issue Aug 24, 2021 · 1 comment · Fixed by #52049

Comments

@theraot
Copy link
Contributor

theraot commented Aug 24, 2021

Godot version

3.2.4.beta5

System information

Windows 10

Issue description

get_base_dir seems to be returning some paths wrong.

print("C:\\puff".get_base_dir()) # outputs "C:\p"
print("C:/puff".get_base_dir()) # outputs "C:/p"

I tested multiple versions of Godot.

These return "C:" : 3.0.stable, 3.2.stable, 3.2.2.stable, 3.2.3.stable, 3.2.4.beta3, 3.2.4.beta4
These fail※: 4.0.dev※※, 3.4.beta4, 3.4.beta3, 3.3.3.stable, 3.3.2.stable, 3.2.4.beta6, 3.2.4.beta5

※: Meaning they return what I said in comments above.
※※: Built 13bd020

Thus, something went wrong from 3.2.4.beta4 to 3.2.4.beta5. I went over the commits between them, that lead me here: cddff04

Steps to reproduce

Run this code:

print("C:\\puff".get_base_dir()) # outputs "C:\p"
print("C:/puff".get_base_dir()) # outputs "C:/p"

Minimal reproduction project

No response

@theraot
Copy link
Contributor Author

theraot commented Aug 24, 2021

In figuring out the origin of the bug, I got very close to solving it, so I went ahead and made the pull request #52049 which I hope it can be cherry-picked to 3.x. It just changes one character in the source.

theraot added a commit to theraot/godot that referenced this issue Aug 24, 2021
@akien-mga akien-mga added this to the 4.0 milestone Sep 13, 2021
theraot added a commit to theraot/godot that referenced this issue Sep 16, 2021
sairam4123 pushed a commit to sairam4123/godot that referenced this issue Nov 10, 2021
lekoder pushed a commit to KoderaSoftwareUnlimited/godot that referenced this issue Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants