-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With keyring installed, cffi fails to upgrade on Windows #478
Comments
The WinVaultKeyring relies heavily on win32ctypes. My guess is that project uses cffi to bind to the backends. |
I was able to replicate the issue without keyring:
|
The problem stems from the fact that pip imports keyring which imports win32ctypes.pywin32 which imports cffi if available:
|
So I think that either cffi or pywin32-ctypes will need to provide a mechanism that doesn't lock the CFFI dll when it's in use. I don't see how there's anything keyring can do here. |
The error reproduces with the I agree that the immediate cause for the bug is that the DLL is loaded by pywin32-ctypes, but the root cause is the presence of keyring. |
Argh. No, that's not it. The problem is that pip uses keyring if present: pypa/pip#6773, with the usual endless discussion. I was about to blame keyring for manipulating the environment in a nonobvious way that causes pip to load keyring, but pip manages all on its own. pip breaks itself. How very surprising. |
Just for your information, as I searched very long yesterday: the problem is tracked in pypa/pip#8443 |
I would say the root cause is not the presence of keyring, but the proximate cause. As you can see above, I was able to replicate the failure without involving keyring at all, demonstrating that keyring is just one path to the root cause. The root cause is that CFFI, when activated by I've filed pypy/cffi#484 to track the root cause and inquire for a mechanism by which pywin32-ctypes or one of the downstream consumers could avoid locking the package. I don't believe there's anything keyring can do at this time, but I'll re-open if it turns out there is. |
Describe the bug
keyring has no direct or indirect dependency on cffi, but with keyring installed, pip on Windows cannot uninstall, and hence not upgrade, cffi. The error indicates that
_cffi_backend.cp38-win_amd64.pyd
i.e. a C module, is loaded.To Reproduce
Steps to reproduce the behavior:
py -m venv test
test\scripts\activate.bat
python -m pip install -U pip setuptools
pip install cffi==1.14.3
pip install --upgrade cffi
Result: Successful update to (as of now) 1.14.4.
pip install cffi==1.14.3
pip install keyring
pip install --upgrade cffi
Result:
pip uninstall keyring
pip install --upgrade cffi
Result: Successful update to 1.14.4 again.
Expected behavior
keyring should not interfere with updating unrelated packages.
Environment
The text was updated successfully, but these errors were encountered: