Commit a5db002
committed
Fix issue with closing session (#200)
I was getting the following error after calling Session.close():
```
Exception in thread session-packet-receiver:
Traceback (most recent call last):
File "librespot-python/librespot/crypto.py", line 58, in receive_encoded
header_bytes = self.__receive_cipher.decrypt(connection.read(3))
~~~~~~~~~~~~~~~^^^
File "librespot-python/librespot/core.py", line 1889, in read
return self.__socket.recv(length)
~~~~~~~~~~~~~~~~~~^^^^^^^^
OSError: [Errno 9] Bad file descriptor
```
Adding `OSError` to the try/except in `CipherPair.receive_encoded` fixes this issue, making
`CipherPair` raise a `RuntimeError` instead, which is properly handled by `Receiver`.1 parent 59b15ae commit a5db002
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
0 commit comments