Skip to content

Commit

Permalink
Do not depend on cached download for copying downloaded file (#7474)
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg authored Dec 13, 2019
2 parents b44c217 + 7dea92e commit b9bdad2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pip/_internal/operations/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ def unpack_http_url(
unpack_file(from_path, location, content_type)

# a download dir is specified; let's copy the archive there
if download_dir and not already_downloaded_path:
if download_dir and not os.path.exists(
os.path.join(download_dir, link.filename)
):
_copy_file(from_path, download_dir, link)


Expand Down Expand Up @@ -260,7 +262,9 @@ def unpack_file_url(
unpack_file(from_path, location, content_type)

# a download dir is specified and not already downloaded
if download_dir and not already_downloaded_path:
if download_dir and not os.path.exists(
os.path.join(download_dir, link.filename)
):
_copy_file(from_path, download_dir, link)


Expand Down

0 comments on commit b9bdad2

Please sign in to comment.