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

Home Directory Path Shortcut doesn't work in Linux #925

Closed
fubuloubu opened this issue Jun 22, 2018 · 1 comment
Closed

Home Directory Path Shortcut doesn't work in Linux #925

fubuloubu opened this issue Jun 22, 2018 · 1 comment

Comments

@fubuloubu
Copy link
Contributor

  • Version: 4.4.0
  • Python: 3.6.5 (P.S. this field is old!)
  • OS: linux

What was wrong?

In linux, the home directory path shortcut ~ doesn't work

w3 = Web3(Web3.IPCProvider("/home/bryant/.ethereum/testnet/geth.ipc")); w3.isConnected()
True

w3 = Web3(Web3.IPCProvider("~/.ethereum/testnet/geth.ipc")); w3.isConnected()
False

How can it be fixed?

IDK

@pipermerriam
Copy link
Member

I think we recently merged #921 which allows for pathlib.Path objects. I think what we need to do now, is invert that and do the following.

if isinstance(ipc_path, str):
    ipc_path = pathlib.Path(ipc_path)
elif not isinstance(ipc_path, pathlib.Path):
    raise TypeError("helpful error message about what types are accepted")

ipc_path_str = ipc_path.expanduser().resolve()

This should handle conversion to an absolute path as well as handling ~.

@carver carver closed this as completed Oct 12, 2018
kclowes added a commit that referenced this issue Apr 25, 2019
Fix for #925, added support for tilda in provider ipc path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants