Comments (7)
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.
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.
It looks like an string encoding issue.
Can you help debug the issue? I do not use Windows.
from pyscard.
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.
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.
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.
No answer since 2 months. I guess you solved the problem.
Closing.
from pyscard.
Related Issues (20)
- Download artifacts for Windows HOT 2
- Windows EXE and MSI missing for Python 3.10 in collected artifacts HOT 3
- Wheels for macOS (all Python versions) HOT 11
- Consolidate GHA pipeline (cross-platform tests, PyPI releases) HOT 2
- Some missing steps in "Installing on windows from the binary distribution" HOT 4
- Failed to list readers: The Smart Card Resource Manager is not running HOT 7
- OS-dependent behaviour: HOT 4
- I can not read more than 8 cards, I think it is the cache memory of the library HOT 5
- Order of readers in list change arbitrarily HOT 15
- Typo in some method names in documentation HOT 1
- python3 -m pip install pyscard fails on MacOS HOT 2
- drop deprecated use of `imp` HOT 2
- pyscard seems to be not thread save HOT 2
- new release? HOT 1
- 2.0.8: compile time warnings HOT 3
- TypeError: CardRequestTimeoutException.__init__() got an unexpected keyword argument 'hresult' HOT 1
- Unexpected keyword argument 'hresult' for CardRequestTimeoutException HOT 2
- pyscard mutes/hides user created exceptions in `on_insert()` hook. HOT 5
- The Smart Card Resource Manager is not running. (0x8010001D) HOT 13
- Could not build wheels for pyscard HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyscard.