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

Unexpected keyword argument 'hresult' for CardRequestTimeoutException #166

Closed
BoLer1 opened this issue Apr 5, 2024 · 2 comments
Closed

Comments

@BoLer1
Copy link

BoLer1 commented Apr 5, 2024

Your system information

  • Operating system used: Windows 11 23H2 (Build 22631.3374)
  • pyscard version: 2.0.8
  • Python version: 3.8.11 % 3.12.2 (conda)

Please describe your issue in as much detail as possible:

Describe what you expected should happen.

-> CardRequestTimeoutException should be created and thrown

Describe what did happen.

-> CardRequestTimeoutException throws error on its init

Steps for reproducing this issue:

3.8.11 and 3.12.2 are conda manage environments.
Both are naked -> Only Base python, pip and pyscard

I appended a simple snipped for reproduction.

from smartcard.CardType import AnyCardType
from smartcard.CardRequest import CardRequest
from smartcard.Exceptions import CardRequestTimeoutException

cardtype = AnyCardType()
cardrequest = CardRequest(timeout=1, cardType=cardtype)
while (1):
    try:
        cardservice = cardrequest.waitforcard()   
    except CardRequestTimeoutException:
        continue	

Traceback:

Traceback (most recent call last):
  File "blabla\test.py", line 13, in <module>
    cardservice = cardrequest.waitforcard()   
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "blabla\Lib\site-packages\smartcard\CardRequest.py", line 68, in waitforcard
    return self.pcsccardrequest.waitforcard()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "blabla\Lib\site-packages\smartcard\pcsc\PCSCCardRequest.py", line 216, in waitforcard
    raise CardRequestTimeoutException(hresult=hresult)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: CardRequestTimeoutException.__init__() got an unexpected keyword argument 'hresult'
@BoLer1 BoLer1 changed the title Unexpected kexword argument 'hresult' for CardRequestTimeoutException Unexpected keyword argument 'hresult' for CardRequestTimeoutException Apr 5, 2024
@LudovicRousseau
Copy link
Owner

The problem should already be fixed in 7711146

I will make a new release "soon".

@BoLer1 BoLer1 closed this as completed Apr 6, 2024
@LudovicRousseau
Copy link
Owner

Version 2.0.9 is available
https://pypi.org/project/pyscard/#files

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

No branches or pull requests

2 participants