Closed Goblenus closed 5 years ago
Your patch is nice but not complete.
>>> from smartcard.System import readers
>>> readers()
[]
>>> readers()
['reader name']
>>> readers()
Failed to SCardFreeMemory!
Traceback (most recent call last):
File "C:\Users\Ludovic\AppData\Local\Programs\Python\Python36\lib\site-packages\smartcard\pcsc\PCSCReader.py", line 113, in readers
pcsc_readers = __PCSCreaders__(hcontext, groups)
File "C:\Users\Ludovic\AppData\Local\Programs\Python\Python36\lib\site-packages\smartcard\pcsc\PCSCReader.py", line 49, in __PCSCreaders__
raise CardServiceStoppedException()
smartcard.Exceptions.CardServiceStoppedException
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "
Can you fix that? Thanks.
It seems I forget to "getContext()" from "PCSCContext.establish_new_context()".
I'll check it on Monday. Is it ok?
OK for me. Take your time to provide a correct patch.
The problem is that your new method releaseContext()
must create a new PC/SC context. Or getContext()
will return a now invalid context.
__PCSCContextSingleton
is no more really a singleton.
I propose to rename establish_new_context()
in renewContext()
Ok. I done it.
Now I think this is not the best way how I have fixed it, I need some time to think. But it works nice and you can merge it.
OS: Windows 10 Pro (10.0.17134) Reader (tested on): Athena ASEDrive V3CR, ARDS JaCarta, Aladdin R.D. JaCarta3 Python version: 3.7 pyscard version: 1.9.7
Behavior:
How it was fixed: