tzeumer / SIP2-Client-for-Python

MIT License
8 stars 13 forks source link

OSError: [Errno 9] Bad file descriptor #1

Open daltonfury42 opened 7 years ago

daltonfury42 commented 7 years ago

When I give a invalid location or institiution, I get this error:

Sip2Wrapper object unset
Exception ignored in: <bound method Sip2Wrapper.__del__ of <sip2.wrapper.Sip2Wrapper object at 0x7fb5ab2dce80>>
Traceback (most recent call last):
  File "/home/kiosk/library-kiosk/library_kiosk/check_out/sip2/wrapper.py", line 135, in __del__
  File "/home/kiosk/library-kiosk/library_kiosk/check_out/sip2/wrapper.py", line 155, in disconnect
  File "/home/kiosk/library-kiosk/library_kiosk/check_out/sip2/sip2.py", line 501, in disconnect
OSError: [Errno 9] Bad file descriptor
Sip2 object unset
Exception ignored in: <bound method Sip2.__del__ of <sip2.sip2.Sip2 object at 0x7fb5a976bef0>>
Traceback (most recent call last):
  File "/home/kiosk/library-kiosk/library_kiosk/check_out/sip2/sip2.py", line 152, in __del__
  File "/home/kiosk/library-kiosk/library_kiosk/check_out/sip2/sip2.py", line 501, in disconnect
OSError: [Errno 9] Bad file descriptor

Better throw an appropriate exception

tzeumer commented 7 years ago

Hi @daltonfury42

I didn't expect that anyone would ever be interested in this module. I just pushed some changes I did a few months ago, but which never reached this repository. Maybe (probably not) it's already fixed, since I slightly changed logging and error handling.

As some time passed since I've last been working on this topic, I'm not really sure what could qualify as "invalid location or institution". For all I know my SIP2 server doesn't really care about those. On the other hand I didn't really think input verification/sanitization would be necessary on this level :)

Since I'm currently not into the topic, I probably won't be able to put much time into this. But I think it's not really a breaking bug?

Greeting, Tobias

PS: So you are building an app for a selfcheck device? Cool. I never really stepped (far) over the starting line for that, but since people are sometimes unexpectedly interested in such stuff, I pushed some very basic try of mine here: https://github.com/tzeumer/SelfcheckApp