Closed mayito closed 7 years ago
Your sample code works fine for me on Mac OS X Yosemite.
I do not use Windows myself. If you can propose a patch for Windows that would help a lot.
@mayito, hello. Did you find a solution?
Maybe the change in #22 could help.
I guess that #22 fixed the problem for you since I got no feedback. Closing.
I use pyscard-1.9.17, but i got this problem too. I guess that #22 do not fixed the problem.
Traceback (most recent call last): File "C:\Users\lei.virtualenvs\TestTool-gkAj8wo0\lib\site-packages\smartcard\CardMonitoring.py", line 162, in run currentcards = self.cardrequest.waitforcardevent() File "C:\Users\lei.virtualenvs\TestTool-gkAj8wo0\lib\site-packages\smartcard\CardRequest.py", line 73, in waitforcardevent return self.pcsccardrequest.waitforcardevent() File "C:\Users\lei.virtualenvs\TestTool-gkAj8wo0\lib\site-packages\smartcard\pcsc\PCSCCardRequest.py", line 288, in waitforcardevent readernames = self.getReaderNames() File "C:\Users\lei.virtualenvs\TestTool-gkAj8wo0\lib\site-packages\smartcard\pcsc\PCSCCardRequest.py", line 90, in getReaderNames raise ListReadersException(hresult) ListReadersException: ('Failed to list readers', -2146435042L)
Hi,
I've noticed pyscard is not able to maintain the list of readers when a reader is connected / disconnected to / from my computer which runs on Windows 8.1 (64 bits).
I've written the following piece of code from the documentation to see if connections and disconnections of the reader are well detected :
If the reader is connected before launching the program, it is well detected. But if it is connected / deconnected during the observer loop a ListReadersException is raised.
To avoid the problem, is there a way to force the reload of the entire pyscard module on demand ?
Cheers,
Thierry.