Giter VIP home page Giter VIP logo

Comments (7)

LudovicRousseau avatar LudovicRousseau commented on June 19, 2024

What is the result of the execution of the script bellow:

#! /usr/bin/env python

from smartcard.scard import *


def test_getReturnCodes():
    errors = (
        SCARD_S_SUCCESS,
        SCARD_F_INTERNAL_ERROR,
        SCARD_E_CANCELLED,
        SCARD_E_INVALID_HANDLE,
        SCARD_E_INVALID_PARAMETER,
        SCARD_E_INVALID_TARGET,
        SCARD_E_NO_MEMORY,
        SCARD_F_WAITED_TOO_LONG,
        SCARD_E_INSUFFICIENT_BUFFER,
        SCARD_E_UNKNOWN_READER,
        SCARD_E_TIMEOUT,
        SCARD_E_SHARING_VIOLATION,
        SCARD_E_NO_SMARTCARD,
        SCARD_E_UNKNOWN_CARD,
        SCARD_E_CANT_DISPOSE,
        SCARD_E_PROTO_MISMATCH,
        SCARD_E_NOT_READY,
        SCARD_E_INVALID_VALUE,
        SCARD_E_SYSTEM_CANCELLED,
        SCARD_F_COMM_ERROR,
        SCARD_F_UNKNOWN_ERROR,
        SCARD_E_INVALID_ATR,
        SCARD_E_NOT_TRANSACTED,
        SCARD_E_READER_UNAVAILABLE,
        SCARD_E_PCI_TOO_SMALL,
        SCARD_E_READER_UNSUPPORTED,
        SCARD_E_DUPLICATE_READER,
        SCARD_E_CARD_UNSUPPORTED,
        SCARD_E_NO_SERVICE,
        SCARD_E_SERVICE_STOPPED,
        SCARD_E_UNEXPECTED,
        SCARD_E_ICC_INSTALLATION,
        SCARD_E_ICC_CREATEORDER,
        SCARD_E_UNSUPPORTED_FEATURE,
        SCARD_E_DIR_NOT_FOUND,
        SCARD_E_FILE_NOT_FOUND,
        SCARD_E_NO_DIR,
        SCARD_E_NO_FILE,
        SCARD_E_NO_ACCESS,
        SCARD_E_WRITE_TOO_MANY,
        SCARD_E_BAD_SEEK,
        SCARD_E_INVALID_CHV,
        SCARD_E_UNKNOWN_RES_MNG,
        SCARD_E_NO_SUCH_CERTIFICATE,
        SCARD_E_CERTIFICATE_UNAVAILABLE,
        SCARD_E_NO_READERS_AVAILABLE,
        SCARD_E_COMM_DATA_LOST,
        SCARD_E_NO_KEY_CONTAINER,
        SCARD_E_SERVER_TOO_BUSY,
        SCARD_W_UNSUPPORTED_CARD,
        SCARD_W_UNRESPONSIVE_CARD,
        SCARD_W_UNPOWERED_CARD,
        SCARD_W_RESET_CARD,
        SCARD_W_REMOVED_CARD,
        SCARD_W_SECURITY_VIOLATION,
        SCARD_W_WRONG_CHV,
        SCARD_W_CHV_BLOCKED,
        SCARD_W_EOF,
        SCARD_W_CANCELLED_BY_USER,
        SCARD_W_CARD_NOT_AUTHENTICATED,
        )
    for e in errors:
        print(hex((e+0x100000000) & 0xFFFFFFFF), SCardGetErrorMessage(e))


if __name__ == '__main__':
    test_getReturnCodes()

from pyscard.

consulttelecom avatar consulttelecom commented on June 19, 2024

Traceback (most recent call last):
File "C:/Python34/testsimscript.py", line 74, in
test_getReturnCodes()
File "C:/Python34/testsimscript.py", line 70, in test_getReturnCodes
print(hex((e+0x100000000) & 0xFFFFFFFF), SCardGetErrorMessage(e))
File "C:\Python34\lib\site-packages\pyscard-1.9.0-py3.4-win-amd64.egg\smartcard\scard\scard.py", line 1241, in SCardGetErrorMessage
return _scard.SCardGetErrorMessage(lErrCode)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 0: invalid continuation byte

from pyscard.

LudovicRousseau avatar LudovicRousseau commented on June 19, 2024

It looks like an string encoding issue.
Can you help debug the issue? I do not use Windows.

from pyscard.

consulttelecom avatar consulttelecom commented on June 19, 2024

I think it is the issue of string encoding between Python 3 and Python 2.
Sure, I can help. What kind of debug do you need?

from pyscard.

LudovicRousseau avatar LudovicRousseau commented on June 19, 2024

I also think it is a encoding issue.
The problem is that I do not use Windows myself so it is hard for me to debug this Windows only problem.

from pyscard.

LudovicRousseau avatar LudovicRousseau commented on June 19, 2024

I have no problem with Python 3.4 on Windows 7 32-Bits using the .msi installer available at https://ci.appveyor.com/project/LudovicRousseau/pyscard/build/job/sktrggp6yxxofqgb/artifacts

What version of Windows do you use?
How have you installed pyscard?

from pyscard.

LudovicRousseau avatar LudovicRousseau commented on June 19, 2024

No answer since 2 months. I guess you solved the problem.
Closing.

from pyscard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.