#3 scard missing CARD_E_NO_READERS_AVAILABLE definition

closed-fixed
5
2009-07-24
2009-05-28
No

Description: Ubuntu 9.04
Release: 9.04

libpcsclite1:
Installed: 1.4.102-1ubuntu2
Candidate: 1.4.102-1ubuntu2
Version table:
*** 1.4.102-1ubuntu2 0
500 http://no.archive.ubuntu.com jaunty/main Packages
100 /var/lib/dpkg/status

I try to use readers in smartcard.System. With no reader connected, I except to be return an empty list.

Instead, I get: NameError: global name 'SCARD_E_NO_READERS_AVAILABLE' is not defined

[kjelle:~/]$ python
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from smartcard.System import readers
>>> readers = readers()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/lib/python-support/python2.6/smartcard/System.py", line 40, in readers
return smartcard.pcsc.PCSCReader.readers( groups )
File "/var/lib/python-support/python2.6/smartcard/pcsc/PCSCReader.py", line 105, in readers
for reader in __PCSCreaders__( groups ):
File "/var/lib/python-support/python2.6/smartcard/pcsc/PCSCReader.py", line 46, in __PCSCreaders__
if hresult==SCARD_E_NO_READERS_AVAILABLE:
NameError: global name 'SCARD_E_NO_READERS_AVAILABLE' is not defined
>>>

The problem seem to be that smartcard/scard/scard.py is missing the SCARD_E_NO_READERS_AVAILABLE declaration!

Discussion

    • status: open --> closed-fixed
     
  • Hi Kjell
    thanks for your feedback; this issue has been fixed in release 1.6.8 uploaded on the server today;
    thanks for using pyscard
    brgds
    jda