Duplicate module silently replaces existing module in dmypy recheck --update
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
If one has these two files:
# [file a/mod.py]
# empty
# [file b/mod.py]
42 + 'no'
and there are no __init__.py[i] files in the directories, then running dmypy produces the following result:
$ dmypy start -- --follow-import=skip
Daemon started
$ dmypy check a/mod.py
$ dmypy recheck --update b/mod.py
b/mod.py:1: error: Unsupported operand types for + ("int" and "str")
$ dmypy recheck --remove b/mod.py
b/mod.py:1: error: Unsupported operand types for + ("int" and "str")
$ dmypy recheck --update a/mod.py
b/mod.py:1: error: Unsupported operand types for + ("int" and "str")
The problem here is twofold:
- When we first trying to add the duplicate module, this should cause a blocking error, as in normal/incremental run instead of silently replacing the other module.
- Even after one tries to remove the problematic module, it stays in build causing errors in all subsequent runs independently of what is done (except just stopping the daemon).
This is high priority because it causes troubles when adding files in existing large codebases.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the sequence with dmypy start, check, recheck --update, recheck --remove, and recheck --update using the two duplicate mod.py files. Trace how the daemon handles duplicate modules during update and removal. Done means adding the duplicate reports a blocking error, removing it clears the stale module, and later rechecks no longer report its error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100