Commit Graph

5 Commits

Author SHA1 Message Date
Christian Vanderwall
a5db002f00 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`.
2025-03-31 14:58:38 -07:00
deepsource-autofix[bot]
dc54445e9a Format code with yapf 2021-12-26 04:59:57 +00:00
deepsource-autofix[bot]
c3865ca093 Iterate dictionary directly 2021-12-26 04:59:47 +00:00
deepsource-autofix[bot]
0741dbdd43 Format code with yapf
This commit fixes the style issues introduced in 2790f48 according to the output
from yapf.

Details: https://deepsource.io/gh/kokarare1212/librespot-python/transform/04a80a03-ea85-44b3-9159-2580bda68c1c/
2021-09-12 04:58:42 +00:00
kokarare1212
01914c44c9 Rewrite 2021-09-12 12:58:24 +09:00