forked from cw-leia/smartleia
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
On latest git version
commit 25ee90ed9d65c42973be361d22f60b450d22b8dd (HEAD -> master, origin/master, origin/HEAD)
If I try to use the 'is_card_inserted' command without correct permissions it fails doing infinite recursion on getattr.
develop@ubuntu:~/LeiaStuff/smartleia$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import smartleia as sl
>>> reader = sl.LEIA()
>>> reader.is_card_inserted()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/develop/LeiaStuff/smartleia/smartleia/__init__.py", line 1023, in is_card_inserted
self._send_command(b"?")
File "/home/develop/LeiaStuff/smartleia/smartleia/__init__.py", line 1093, in _send_command
self._testWaitingFlag()
File "/home/develop/LeiaStuff/smartleia/smartleia/__init__.py", line 711, in _testWaitingFlag
self.ser.read_all()
File "/home/develop/LeiaStuff/smartleia/smartleia/__init__.py", line 1107, in __getattr__
if hasattr(self.ser, attr):
File "/home/develop/LeiaStuff/smartleia/smartleia/__init__.py", line 1107, in __getattr__
if hasattr(self.ser, attr):
File "/home/develop/LeiaStuff/smartleia/smartleia/__init__.py", line 1107, in __getattr__
if hasattr(self.ser, attr):
[Previous line repeated 993 more times]
RecursionError: maximum recursion depth exceeded
When running under sudo everything is nice and dandy.
develop@ubuntu:~/LeiaStuff/smartleia$ sudo python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import smartleia as sl
>>> sl
KeyboardInterrupt
>>> reader = sl.LEIA()
read>>> reader.is_card_inserted()
True
>>> reader.is_card_inserted()
True
>>> reader.is_card_inserted()
False
>>>
A clearer error would be preferable.
Metadata
Metadata
Assignees
Labels
No labels