Skip to content

Improved support for Windows systems#651

Merged
mildbyte merged 1 commit intosplitgraph:masterfrom
Trase:master
Mar 15, 2022
Merged

Improved support for Windows systems#651
mildbyte merged 1 commit intosplitgraph:masterfrom
Trase:master

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.

2 participants