python-poetry / python-poetry/poetry

“poetry cache clear” failed to remove corrupted artifacts

Open
#6,151 6 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: windows 10
  • Poetry version: 1.1.14
  • Link of a Gist with the contents of your pyproject.toml file: (none)

Issue

(I managed to solve the problem, but still decided to report this as I suppose this may be a solution to some hash&cache related issues)

I encountered an internet connection problem during installing NumPy to a new poetry environment, manually closed the poetry command window, and retried poetry install after regaining internet connection, but got

Invalid hashes (sha256:81efafdaee436f1f34e9121d9ea96fa95d20c73390cd2874fe3ffc75cc86425a) for NumPy (1.23.1) using archive NumPy-1.23.1-cp39-cp39-win_amd64.whl.

Like the suggestions related to hash resolve issues, I tried poetry cache clear . --all, poetry cache clear --all pypi and deleting poetry.toml, but I still got the same RuntimeError.
Then I tried to find the .whl document and found it in

C:\Users\(username)\AppData\Local\pypoetry\Cache\artifacts...

After that I deleted all documents in artifacts directory, and then everything goes smoothly.
It seems that on windows the cache clear command only removes caches in C:\Users\(username)\AppData\Local\pypoetry\Cache\\**cache**, but the artifacts document on the same level with "cache" is untouched. I believe some cache-related problems that couldn't be solved by running poetry cache clear are related to this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the poetry cache clear command and reproduce the Windows behavior described for C:\Users\\(username)\AppData\Local\pypoetry\Cache\, comparing the cache and artifacts directories. Confirm that clearing the cache removes corrupted NumPy artifacts as well, then verify the command with a Windows-focused regression test if the project provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.