-
Notifications
You must be signed in to change notification settings - Fork 1.8k
web3.providers.ipc.get_default_ipc_path()
returned None
instead of str
#2911
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
Comments
For us, it is most useful to have this path even if it does not currently exist yet, since it may not exist at config time but may exist once starting geth, but it is also a flag for the geth cmd itself if sys.platform == "darwin":
return os.path.expanduser(os.path.join("~", "Library", "Ethereum", "geth.ipc"))
elif sys.platform.startswith("linux") or sys.platform.startswith("freebsd"):
return os.path.expanduser(os.path.join("~", ".ethereum", "geth.ipc"))
elif sys.platform == "win32":
return os.path.join("\\\\", ".", "pipe", "geth.ipc")
else:
raise ValueError(
f"Unsupported platform '{sys.platform}'. Only darwin/linux/win32/"
"freebsd are supported. You must specify the ipc_path"
) |
This is cracking me up 😆 It would be a small breaking change to return the path even if it doesn't exist, but I changed the type and made the |
pip freeze
outputWhat was wrong?
The method
get_deafult_ipc_path()
located inweb3.providers.ipc
returnedNone
even though its return type is documented asstr
.I am not sure why it returned
None
in my case, probably forgot some flag ingeth
.Edit: it returned None in my case because i was checking it before starting geth, so it didnt exist yet.
How can it be fixed?
Either change type to
Optional[str]
or raise an error instead of returningNone
?Note: We prefer to use issues to track our work. If you think you've encountered a bug in web3py or
have a feature request, you're in the right place. If you have implementation or usage questions,
please refer to our documentation and/or join the conversation
on discord.
The text was updated successfully, but these errors were encountered: