8000 pip should refuse by default to overwrite non-managed files. · Issue #3868 · pypa/pip · GitHub
[go: up one dir, main page]

Skip to content
pip should refuse by default to overwrite non-managed files. #3868
@anntzer

Description

@anntzer
  • Pip version: 8.1.2
  • Python version: 3.5.2
  • Operating System: Arch Linux

pip will happily overwrite files it does not manage, e.g. in ~/.local/bin

Trivial example:

$ python2 -mpip install --user pipdeptree && python3 -mpip install --user pipdeptree

The second invocation overwrites ~/.local/bin/pipdeptree.
While this example just involves two different versions of Python, the overwritten file may very well not have anything to do with Python, which can lead to a lot of head-scratching.

It would be much nicer if pip simply refused, by default, to overwrite files it did not install (it, meaning including whichever version/venv of python is actually running). It can always print something like "Installing requires overwriting the following file(s), that I am not aware of. Re-run with --force-overwrite to overwrite them.".

Related to #2274, #2973.

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-lockedOutdated issues that have been locked by automationresolution: duplicateDuplicate of an existing issue/PRtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0