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

False positive for python stdlib shelve.open() #11856

Closed
ReagentX opened this issue May 2, 2024 · 1 comment · Fixed by #11881
Closed

False positive for python stdlib shelve.open() #11856

ReagentX opened this issue May 2, 2024 · 1 comment · Fixed by #11881

Comments

@ReagentX
Copy link

ReagentX commented May 2, 2024

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 version used: mypy 1.10.0 (compiled: yes)
  • Mypy command-line flags: None
  • Mypy configuration options from mypy.ini (and other config files): None
  • Python version used: 3.12.2
@hauntsaninja hauntsaninja transferred this issue from python/mypy May 2, 2024
@hauntsaninja
Copy link
Collaborator

Thanks! Changes should also be made to dbm

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 a pull request may close this issue.

2 participants