-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
-
Poetry version: 1.7.0
-
Python version: 3.11.6
-
OS version and name: Debian trixie (testing) running in a Chrome OS Linux container
-
pyproject.toml: https://gist.github.com/ilyagr/1bebabebc93e6662d139009d19ed8c1b/edit (includes poetry.lock and detailed command-line output as well).
-
I am on the latest stable Poetry version, installed using a recommended method.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
I have consulted the FAQ and blog for any relevant entries or release notes.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption) and have included the output below.
Issue
This is a follow-up to #1917 and #8227. I also mentioned this briefly in
#1917 (comment)
The bug happens when I run either poetry install or poetry lock.
-
Poetry 1.6.1 behavior: a Gnome (gnome-keyring or seahorse, I'm unsure) window opens and asks to unlock a keyring. If I click cancel (refuse to unlock the keyring), poetry fails with an exception as described in fix: remove exception when keyring is locked #8227.
-
Current Poetry 1.7 behavior: no Gnome window opens, poetry just freezes for a while.
With Poetry 1.7, I also tried rebooting. After a reboot, a Gnome window does appear. After clicking cancel (refuse to unlock the keyring), it reappears. After clicking cancel ~10 more times, it stops reappearing and hangs again.
rm -r ~/.cache/pypoetry as suggested in #1917 (comment) did not help, with or without reinstalling poetry (via pipx, in my case)
Expected behavior
poetry does not try to unlock the keyring unless it is performing an operation that can't succeed without access to the keyring (e.g., already failed without access to the keyring).
Alternatively, a somewhat inferior option would be to have some way to tell poetry not to try unlocking any keyrings that is easier to discover than the workaround below. Additionally, there would be a user-friendly message suggesting that option whenever unlocking the keyrings doesn't work.
Workaround
The workaround of export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring from #1917 (comment) still works.
Update: #8623 (comment) suggests that poetry config keyring.enabled false is a more permanent workaround.
Command-line output
See https://gist.github.com/ilyagr/1bebabebc93e6662d139009d19ed8c1b for details.
The end of it is often the following printed to stderr:
[keyring.backend] Loading SecretService
[keyring.backend] Loading Windows
[keyring.backend] Loading chainer
[keyring.backend] Loading libsecret
[keyring.backend] Loading macOS
At this point, it hangs forever.