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

More robust home directory handling #74

Merged
merged 1 commit into from
Nov 16, 2023
Merged

More robust home directory handling #74

merged 1 commit into from
Nov 16, 2023

Conversation

xenpie
Copy link
Contributor

@xenpie xenpie commented Nov 15, 2023

No description provided.

@xenpie
Copy link
Contributor Author

xenpie commented Nov 15, 2023

For me the application wasn't working initially because I changed my Windows account name when switching from a Microsoft to a local account. Although my Username was changed the directory still uses the previous name and therefore f"C:/Users/{os.getlogin()}" didn't return the correct path. Using os.path.expanduser('~') should always return the correct home directory.

@xenpie
Copy link
Contributor Author

xenpie commented Nov 15, 2023

Alternatively you could also use os.environ['USERPROFILE'] or perhaps pathlib.Path.home() but I haven't tested those.

@aeon0 aeon0 self-requested a review November 16, 2023 17:44
Copy link
Contributor

@aeon0 aeon0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, didnt know about that

@aeon0 aeon0 merged commit e642a7e into d4lfteam:main Nov 16, 2023
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