Skip to content
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

Python version 3.12rc1 - cannot find backend (Windows 11) and fatal exception in set #648

Open
johns1c opened this issue Aug 29, 2023 · 5 comments
Labels

Comments

@johns1c
Copy link

johns1c commented Aug 29, 2023

  1. keyring list-backends gives nothing when installed on a Python 3.12-rc1 virtual environment.
  2. calling get_password cause an exit from the Python interpreter

they work perfectly under Python 3.8.10 with previous and the latest versions of keyring

o/s is Microsoft Window 11 pro (10.0.22621) and I am NOT working in a VM or Linux just a command shell
I am not running with admin privs

having just hound the Python -X faulthandler option I get this when running a trivial set and get program, the fault happening in the set call.

(z312) C:\Users\****************\Python\z312>py  -X faulthandler ..\zzzz\test_keyring.py
Starting....
Windows fatal exception: access violation

Current thread 0x000055c4 (most recent call first):
Windows fatal exception: access violation

The trivial code is

import keyring
print( 'Starting....' , flush=True ) 
keyring.set_password("mySystem", "myUsername", "S3CR3T_P455W0RD")
print( 'password should be set' , flush=True ) 
saved_password = keyring.get_password("system", "myUsername")
print( f'{saved_password=} which I believe is a generic password set above ' )
@mfinky
Copy link

mfinky commented Oct 10, 2023

installed python 3.12, downloaded on 2023-10-10 and keyring stopped working. I had been using python 3.11 release until this morning.

@micahellison
Copy link

I was curious if this problem existed on Windows 10 Pro so I tried to reproduce it in Python 3.12. I didn't get the same crash, however, I also didn't get the expected result because there's a problem in the script in this issue: set_password uses "mySystem" as the first arg while get_password uses "system" as the first arg, so it can never get that password. Once I fixed that, it was fine (though I can't speak for Windows 11).

Here's the corrected script, if anyone would like to try this on Windows 11 Pro to repro the issue:

import keyring
print( 'Starting....' , flush=True ) 
keyring.set_password("mySystem", "myUsername", "S3CR3T_P455W0RD")
print( 'password should be set' , flush=True ) 
saved_password = keyring.get_password("mySystem", "myUsername")
print( f'{saved_password=} which I believe is a generic password set above ' )

@jaraco jaraco added the Windows label Nov 12, 2023
@jaraco
Copy link
Owner

jaraco commented Nov 12, 2023

It does sound as if maybe there's a problem on some copies of Python 3.12 on Windows. The test suite does pass on Windows on Python 3.12, so the issue isn't universal. If I get time, I may try to repro on my Windows VM. In the meantime, if anyone can help ascertain exactly what factors are necessary to cause the error, it's appreciated.

@mfinky
Copy link

mfinky commented Nov 12, 2023 via email

@tcumby
Copy link

tcumby commented Jan 9, 2024

I was able to replicate this on a Window 10 Pro VM with Python 3.12.1.

$ set PYTHONMALLOC=debug
$ set PYTHONASYNCIODEBUG=1
$ python -W default -X faulthandler
Python 3.12.1 (tags/v3.12.1:2305ca5, Dec  7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import keyring
>>> keyring.get_password("<server>", "<username>")
<frozen importlib._bootstrap>:918: ImportWarning: BackendLoader.exec_module() not found; falling back to load_module()
Windows fatal exception: access violation

Current thread 0x000061dc (most recent call first):
  <no Python frame>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants