LudovicRousseau / pyscard

pyscard smartcard library for python
http://pyscard.sourceforge.net/
GNU Lesser General Public License v2.1
396 stars 113 forks source link

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd8 in position 0: invalid continuation byte #121

Closed Lunarequest closed 2 years ago

Lunarequest commented 2 years ago

Your system information

On fedora 35 there seems to be a issue with permissions, Yubikey manager and Yubioath Desktop both throw errors about invalid continuation bytes. The traceback says the issue is caused by SCardListReaders. How should I proceed to debug the issue

LudovicRousseau commented 2 years ago

You failed to describe the problem. Include full copy the error message.

Lunarequest commented 2 years ago
Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/ykman/device.py", line 139, in scan_devices
    devs = list_devs()
  File "/app/lib/python3.9/site-packages/ykman/device.py", line 85, in inner
    return f()
  File "/app/lib/python3.9/site-packages/ykman/device.py", line 102, in list_ccid_devices
    return _list_ccid_devices()
  File "/app/lib/python3.9/site-packages/ykman/pcsc/__init__.py", line 164, in list_devices
    for reader in list_readers():
  File "/app/lib/python3.9/site-packages/ykman/pcsc/__init__.py", line 152, in list_readers
    return System.readers()
  File "/app/lib/python3.9/site-packages/smartcard/System.py", line 41, in readers
    return smartcard.reader.ReaderFactory.ReaderFactory.readers(groups)
  File "/app/lib/python3.9/site-packages/smartcard/reader/ReaderFactory.py", line 58, in readers
    zreaders += fm(groups)
  File "/app/lib/python3.9/site-packages/smartcard/pcsc/PCSCReader.py", line 112, in readers
    pcsc_readers = __PCSCreaders__(hcontext, groups)
  File "/app/lib/python3.9/site-packages/smartcard/pcsc/PCSCReader.py", line 43, in __PCSCreaders__
    hresult, readers = SCardListReaders(hcontext, groups)
  File "/app/lib/python3.9/site-packages/smartcard/scard/scard.py", line 640, in SCardListReaders
    return _scard.SCardListReaders(hcontext, readergroups)
SystemError: <built-in function SCardListReaders> returned a result with an error set
LudovicRousseau commented 2 years ago

I don't see a problem with UnicodeDecodeError: 'utf-8'... in your backtrace.

I guess you have a "problem" with your reader name. Install pcsc-tools version 1.5.8 (or more) and give me the output of pcsc_scan -r

LudovicRousseau commented 2 years ago

Without your help I can't work on the issue. With no comments from your part I will close the issue.

LudovicRousseau commented 2 years ago

No feedback. Closing