mtbase 4.32.25__py3-none-any.whl → 4.32.26__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mt/aio/files.py +21 -4
- mt/base/version.py +1 -1
- {mtbase-4.32.25.dist-info → mtbase-4.32.26.dist-info}/METADATA +1 -1
- {mtbase-4.32.25.dist-info → mtbase-4.32.26.dist-info}/RECORD +8 -8
- {mtbase-4.32.25.data → mtbase-4.32.26.data}/scripts/path_exists +0 -0
- {mtbase-4.32.25.dist-info → mtbase-4.32.26.dist-info}/WHEEL +0 -0
- {mtbase-4.32.25.dist-info → mtbase-4.32.26.dist-info}/licenses/LICENSE +0 -0
- {mtbase-4.32.25.dist-info → mtbase-4.32.26.dist-info}/top_level.txt +0 -0
mt/aio/files.py
CHANGED
@@ -5,6 +5,7 @@ import json
|
|
5
5
|
import tempfile
|
6
6
|
import asyncio
|
7
7
|
import aiofiles
|
8
|
+
import time
|
8
9
|
|
9
10
|
from mt import ctx
|
10
11
|
|
@@ -52,11 +53,27 @@ async def read_binary(filepath, size: int = None, context_vars: dict = {}) -> by
|
|
52
53
|
"""
|
53
54
|
|
54
55
|
if context_vars["async"]:
|
55
|
-
|
56
|
-
|
56
|
+
try:
|
57
|
+
async with aiofiles.open(filepath, mode="rb") as f:
|
58
|
+
return await f.read(size)
|
59
|
+
except OSError as e:
|
60
|
+
if e.errno == 24: # too many open files
|
61
|
+
await asyncio.sleep(1)
|
62
|
+
async with aiofiles.open(filepath, mode="rb") as f:
|
63
|
+
return await f.read(size)
|
64
|
+
else:
|
65
|
+
raise
|
57
66
|
else:
|
58
|
-
|
59
|
-
|
67
|
+
try:
|
68
|
+
with open(filepath, mode="rb") as f:
|
69
|
+
return f.read(size)
|
70
|
+
except OSError as e:
|
71
|
+
if e.errno == 24: # too many open files
|
72
|
+
time.sleep(1)
|
73
|
+
with open(filepath, mode="rb") as f:
|
74
|
+
return f.read(size)
|
75
|
+
else:
|
76
|
+
raise
|
60
77
|
|
61
78
|
|
62
79
|
async def write_binary(
|
mt/base/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
mt/aio/__init__.py,sha256=-k13vDemo1Onk3yPWv86zav4HAnimvLVpXdH2mkXRJc,2202
|
2
2
|
mt/aio/base.py,sha256=HE97hmtjHcxA2t_gd4AZ4e5mlRd4lIGY5jY_f65pdPg,3982
|
3
|
-
mt/aio/files.py,sha256=
|
3
|
+
mt/aio/files.py,sha256=0J-3BevUzMP5VmnfBUnJqYbB3MQYPCOSbO0ygLoz5hI,13937
|
4
4
|
mt/aio/multiprocessing.py,sha256=G43P7bN10J7UqTYCsa1eh3VatJWEbLEqg1xNK3MKWdk,8978
|
5
5
|
mt/aio/path.py,sha256=d-zE88pTD65-KskLi6j_1Hdys7NXrDOOmHqUyHYxehY,10041
|
6
6
|
mt/aio/procedure.py,sha256=eJ4AtCxqvDDxGrz-Pycred1CJRfD60VPvjUaaJ0OhYM,3323
|
@@ -24,7 +24,7 @@ mt/base/s3.py,sha256=dt-ph2pBv2oplddlRHCkbP58i4P-g60US6DhC4vAKAA,20083
|
|
24
24
|
mt/base/str.py,sha256=_R1GRJG8XEfUwabz_dsMD-g0zf3bF4b41_L3vXmiI0o,3580
|
25
25
|
mt/base/terminal.py,sha256=_23Kk7oihgCbe2yjJw2SQrTCqymSi-drejn1SWIS6IY,104
|
26
26
|
mt/base/threading.py,sha256=MTVjpaTg_sbZWCksoP_5iMVYFjjUxrgpYBMOWxFY4Ms,110
|
27
|
-
mt/base/version.py,sha256=
|
27
|
+
mt/base/version.py,sha256=Zan_moqEuHmlxhycJJ7rHP0HalhSd-kFuuSsTaszxaw,208
|
28
28
|
mt/base/zipfile.py,sha256=SnsBCaPlPw300_mi7WYB6wSqjvW-U_g96vS2S9JwrnE,1765
|
29
29
|
mt/concurrency/__init__.py,sha256=jF7NoWRKap-QhuJaJZ3EUpfrn2HaZa_8MAS0bT325AY,428
|
30
30
|
mt/concurrency/aio.py,sha256=efStmaQ6JkqdS7fQTcvCmOVH3ylqyKsEG8tjXhZQIZs,24785
|
@@ -57,9 +57,9 @@ mt/time/__init__.py,sha256=lAjC0En0X0spHTu2YC120AchNlv1SzHgQlX0RmXWLEc,2158
|
|
57
57
|
mt/tp/__init__.py,sha256=TvEzpRQpi8eKdt-mGhX6mgkY3V4zB-0RWNf-BiRm1vU,633
|
58
58
|
mt/traceback/__init__.py,sha256=4WUtGbPklLM9s-jlQQrQiFuEaTbKQKeV1DEzRj_HfYY,3648
|
59
59
|
mt/v4l2/__init__.py,sha256=s5a0Ve3QI0I2F2q192qLKfw8dPvcrHRy1JCdpMQz8cE,870
|
60
|
-
mtbase-4.32.
|
61
|
-
mtbase-4.32.
|
62
|
-
mtbase-4.32.
|
63
|
-
mtbase-4.32.
|
64
|
-
mtbase-4.32.
|
65
|
-
mtbase-4.32.
|
60
|
+
mtbase-4.32.26.data/scripts/path_exists,sha256=9rYAZNiVEeTTi-hKM8NkQVIZOaEQkWE_WVw72avfUDo,690
|
61
|
+
mtbase-4.32.26.dist-info/licenses/LICENSE,sha256=PojkRlQzTT5Eg6Nj03XoIVEefN3u8iiIFf1p4rqe_t4,1070
|
62
|
+
mtbase-4.32.26.dist-info/METADATA,sha256=8pzqld5jVNOPF_IonWD6jZrRRPNFpxe9LEq9Qk6m6bU,806
|
63
|
+
mtbase-4.32.26.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
64
|
+
mtbase-4.32.26.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
|
65
|
+
mtbase-4.32.26.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|