We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
shelve.open()
Bug Report
There is a false positive for python stdlib shelve.open() when using a path-like object for the first parameter.
To Reproduce
import shelve from pathlib import Path shelve.open(Path("filename"))
Expected Behavior
This should pass mypy, per the Python docs shelve.open() accepts a path-like object: https://docs.python.org/3/library/shelve.html#shelve.open
Actual Behavior
my.py:4: error: Argument 1 to "open" has incompatible type "Path"; expected "str" [arg-type]
Your Environment
mypy 1.10.0 (compiled: yes)
mypy.ini
The text was updated successfully, but these errors were encountered:
Thanks! Changes should also be made to dbm
Sorry, something went wrong.
Update shelve.open to support path-like objects
shelve.open
18d2bc5
Finally `os.fsencode` is called on `filename` argument here: https://github.com/python/cpython/blob/c0d257cc69a943d2c211fe7ad54e706f1085ba1a/Lib/dbm/__init__.py#L112 Which has this type: https://github.com/python/typeshed/blob/72623c6b151db070817ce4b1c1ad70a6a2007197/stdlib/os/__init__.pyi#L484 Closes #11856
dbm.open
5829e3b
Successfully merging a pull request may close this issue.
Bug Report
There is a false positive for python stdlib
shelve.open()
when using a path-like object for the first parameter.To Reproduce
Expected Behavior
This should pass mypy, per the Python docs
shelve.open()
accepts a path-like object: https://docs.python.org/3/library/shelve.html#shelve.openActual Behavior
my.py:4: error: Argument 1 to "open" has incompatible type "Path"; expected "str" [arg-type]
Your Environment
mypy 1.10.0 (compiled: yes)
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: