Please describe your issue in as much detail as possible:
The following example uses the Session interface to connect to a card. While the script is running, unplug the reader. Consequently, when session.close() is called, this will throw a disconnection error (which is deliberately ignored).
However, some background process still has a connection and fails to report this exception properly when the script exits. That's why python reports this exception by printing it on the command line:
Exception ignored in: <function Session.__del__ at 0x7f8027d240d0>
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/smartcard/Session.py", line 85, in __del__
File "/usr/lib/python3/dist-packages/smartcard/Session.py", line 91, in close
File "/usr/lib/python3/dist-packages/smartcard/CardConnectionDecorator.py", line 58, in disconnect
File "/usr/lib/python3/dist-packages/smartcard/pcsc/PCSCCardConnection.py", line 154, in disconnect
smartcard.Exceptions.CardConnectionException: Failed to disconnect: Invalid value given.
Exception ignored in: <function CardService.__del__ at 0x7f8027d04ee0>
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/smartcard/CardService.py", line 52, in __del__
File "/usr/lib/python3/dist-packages/smartcard/CardConnectionDecorator.py", line 58, in disconnect
File "/usr/lib/python3/dist-packages/smartcard/pcsc/PCSCCardConnection.py", line 154, in disconnect
smartcard.Exceptions.CardConnectionException: Failed to disconnect: Invalid value given.
Exception ignored in: <function PCSCCardConnection.__del__ at 0x7f8027d8de50>
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/smartcard/pcsc/PCSCCardConnection.py", line 88, in __del__
File "/usr/lib/python3/dist-packages/smartcard/pcsc/PCSCCardConnection.py", line 154, in disconnect
smartcard.Exceptions.CardConnectionException: Failed to disconnect: Invalid value given.
Your system information
Please describe your issue in as much detail as possible:
The following example uses the Session interface to connect to a card. While the script is running, unplug the reader. Consequently, when
session.close()
is called, this will throw a disconnection error (which is deliberately ignored).disconnect.txt
However, some background process still has a connection and fails to report this exception properly when the script exits. That's why python reports this exception by printing it on the command line:
Printing this backtrace should be avoided. See https://github.com/python/asyncio/issues/423 for a similar problem
Steps for reproducing this issue:
python disconnect.txt