Skip to content

Commit f895432

Browse files
committed
version 3.18.1
1 parent fcb137b commit f895432

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

docs/api-docs/slack_sdk/socket_mode/builtin/internals.html

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ <h1 class="title">Module <code>slack_sdk.socket_mode.builtin.internals</code></h
2626
<summary>
2727
<span>Expand source code</span>
2828
</summary>
29-
<pre><code class="python">import errno
30-
import hashlib
29+
<pre><code class="python">import hashlib
3130
import itertools
3231
import os
3332
import random
@@ -52,6 +51,8 @@ <h1 class="title">Module <code>slack_sdk.socket_mode.builtin.internals</code></h
5251
line = []
5352
while True:
5453
c = sock.recv(1)
54+
if not c:
55+
raise ConnectionError(&#34;Connection is closed&#34;)
5556
line.append(c)
5657
if c == b&#34;\n&#34;:
5758
break
@@ -142,7 +143,10 @@ <h1 class="title">Module <code>slack_sdk.socket_mode.builtin.internals</code></h
142143
def _read_http_response_line(sock: ssl.SSLSocket) -&gt; str:
143144
cs = []
144145
while True:
145-
c: str = sock.recv(1).decode(&#34;utf-8&#34;)
146+
b: bytes = sock.recv(1)
147+
if not b:
148+
raise ConnectionError(&#34;Connection is closed&#34;)
149+
c: str = b.decode(&#34;utf-8&#34;)
146150
if c == &#34;\r&#34;:
147151
break
148152
if c != &#34;\n&#34;:
@@ -227,19 +231,12 @@ <h1 class="title">Module <code>slack_sdk.socket_mode.builtin.internals</code></h
227231
def receive(specific_buffer_size: Optional[int] = None):
228232
size = specific_buffer_size if specific_buffer_size is not None else receive_buffer_size
229233
with sock_receive_lock:
230-
try:
231-
received_bytes = sock.recv(size)
232-
if all_message_trace_enabled:
233-
if len(received_bytes) &gt; 0:
234-
logger.debug(f&#34;Received bytes: {received_bytes}&#34;)
235-
return received_bytes
236-
except OSError as e:
237-
# For Linux/macOS, errno.EBADF is the expected error for bad connections.
238-
# The errno.ENOTSOCK can be sent when running on Windows OS.
239-
if e.errno in (errno.EBADF, errno.ENOTSOCK):
240-
logger.debug(&#34;The connection seems to be already closed.&#34;)
241-
return bytes()
242-
raise e
234+
received_bytes = sock.recv(size)
235+
if not received_bytes:
236+
raise ConnectionError(&#34;Connection is closed&#34;)
237+
if all_message_trace_enabled:
238+
logger.debug(f&#34;Received bytes: {received_bytes}&#34;)
239+
return received_bytes
243240

244241
return _fetch_messages(
245242
messages=[],

docs/api-docs/slack_sdk/version.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h1 class="title">Module <code>slack_sdk.version</code></h1>
2828
<span>Expand source code</span>
2929
</summary>
3030
<pre><code class="python">&#34;&#34;&#34;Check the latest version at https://pypi.org/project/slack-sdk/&#34;&#34;&#34;
31-
__version__ = &#34;3.18.0&#34;</code></pre>
31+
__version__ = &#34;3.18.1&#34;</code></pre>
3232
</details>
3333
</section>
3434
<section>

slack_sdk/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""Check the latest version at https://pypi.org/project/slack-sdk/"""
2-
__version__ = "3.18.0"
2+
__version__ = "3.18.1"

0 commit comments

Comments
 (0)