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

Improved support for Windows systems #651

Merged
merged 1 commit into from
Mar 15, 2022
Merged

Conversation

harrybiddle
Copy link
Contributor

I was using the helper class class RESTAPIClient in some of my Python code. It worked fine for me, but failed on some of my colleagues which have Windows machines. Even though they had run sgr cloud add and sgr cloud login and their ~/.splitgraph/.sgconfig files looked fine, splitgraph code complained that it couldn't find any configuration for the remote.

While digging into this I discovered that the .sgconfig file is only loaded if the environment variable HOME is set, since it looks in os.environ["HOME"]. Adding the environment variable to my collegues' systems fixed the problem. However, this environment variable is not standard on Windows systems.

A better, cross-platform, way of finding the user's home directory is os.path.expanduser(~).

There is one more instance of os.environ["HOME"] in the codebase but it's in the code for the engine, which I presume always runs on a Unix system anyway.

@mildbyte
Copy link
Contributor

Thanks!

@mildbyte mildbyte merged commit 13673d8 into splitgraph:master Mar 15, 2022
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.

None yet

2 participants