megfile 4.1.7__py3-none-any.whl → 4.1.8.post1__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.
- megfile/http_path.py +4 -3
- megfile/smart.py +12 -4
- megfile/version.py +1 -1
- {megfile-4.1.7.dist-info → megfile-4.1.8.post1.dist-info}/METADATA +1 -1
- {megfile-4.1.7.dist-info → megfile-4.1.8.post1.dist-info}/RECORD +10 -10
- {megfile-4.1.7.dist-info → megfile-4.1.8.post1.dist-info}/WHEEL +0 -0
- {megfile-4.1.7.dist-info → megfile-4.1.8.post1.dist-info}/entry_points.txt +0 -0
- {megfile-4.1.7.dist-info → megfile-4.1.8.post1.dist-info}/licenses/LICENSE +0 -0
- {megfile-4.1.7.dist-info → megfile-4.1.8.post1.dist-info}/licenses/LICENSE.pyre +0 -0
- {megfile-4.1.7.dist-info → megfile-4.1.8.post1.dist-info}/top_level.txt +0 -0
megfile/http_path.py
CHANGED
|
@@ -187,11 +187,12 @@ class HttpPath(URIPath):
|
|
|
187
187
|
response.close()
|
|
188
188
|
raise translate_http_error(error, self.path_with_protocol)
|
|
189
189
|
|
|
190
|
-
|
|
190
|
+
headers = response.headers
|
|
191
|
+
content_size = int(headers.get("Content-Length", 0))
|
|
191
192
|
if (
|
|
192
|
-
|
|
193
|
+
headers.get("Accept-Ranges") == "bytes"
|
|
193
194
|
and content_size >= block_size * 2
|
|
194
|
-
and not
|
|
195
|
+
and not headers.get("Content-Encoding")
|
|
195
196
|
):
|
|
196
197
|
response.close()
|
|
197
198
|
|
megfile/smart.py
CHANGED
|
@@ -307,6 +307,16 @@ def _default_copy_func(
|
|
|
307
307
|
pass
|
|
308
308
|
|
|
309
309
|
|
|
310
|
+
def _get_copy_func(src_protocol, dst_protocol):
|
|
311
|
+
if src_protocol.startswith("s3+") and src_protocol == dst_protocol:
|
|
312
|
+
src_protocol = dst_protocol = "s3"
|
|
313
|
+
|
|
314
|
+
try:
|
|
315
|
+
return _copy_funcs[src_protocol][dst_protocol]
|
|
316
|
+
except KeyError:
|
|
317
|
+
return _default_copy_func
|
|
318
|
+
|
|
319
|
+
|
|
310
320
|
def smart_copy(
|
|
311
321
|
src_path: PathLike,
|
|
312
322
|
dst_path: PathLike,
|
|
@@ -351,10 +361,8 @@ def smart_copy(
|
|
|
351
361
|
src_protocol, _ = SmartPath._extract_protocol(src_path)
|
|
352
362
|
dst_protocol, _ = SmartPath._extract_protocol(dst_path)
|
|
353
363
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
except KeyError:
|
|
357
|
-
copy_func = _default_copy_func
|
|
364
|
+
copy_func = _get_copy_func(src_protocol, dst_protocol)
|
|
365
|
+
|
|
358
366
|
try:
|
|
359
367
|
copy_func(
|
|
360
368
|
src_path,
|
megfile/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = "4.1.
|
|
1
|
+
VERSION = "4.1.8.post1"
|
|
@@ -7,18 +7,18 @@ megfile/fs_path.py,sha256=Hozl9LAJ8EMuSWBSZXGj2GNmPZ1sJp9PZs-7hPrLgm8,39341
|
|
|
7
7
|
megfile/hdfs.py,sha256=owXr4d3j1frCvlbhmhENcSBnKKDky5cJZzWLOF4ZJMo,13251
|
|
8
8
|
megfile/hdfs_path.py,sha256=OmUe3vA3Qoxnqtcq0Rs3ygBvzAtqUz3fGo8iP5sWneE,26058
|
|
9
9
|
megfile/http.py,sha256=1nuGe-JbnwMFyV3s35CJxByED3uoRoS9y8Y8cSGP9Kw,3865
|
|
10
|
-
megfile/http_path.py,sha256=
|
|
10
|
+
megfile/http_path.py,sha256=08OmzmRMyLSyq1Yr1K2HbzexesURJrIoA6AibwYzUiA,13844
|
|
11
11
|
megfile/interfaces.py,sha256=p4UvVZpeLx5djd6bqqDaygIx_s-_AxIVj-gudTch4JE,8467
|
|
12
12
|
megfile/pathlike.py,sha256=3Hnw-fn6RcIe9iPrJt00QdHSA--UfDyxnVBuZ_ymYYQ,31278
|
|
13
13
|
megfile/s3.py,sha256=abBxnI7RIyn7n7qjGszP1VruYd6Gi9I8QnUOvsHkx1Y,16325
|
|
14
14
|
megfile/s3_path.py,sha256=4vKdn5RupvSMYelYznCMDpE1t-87H3iwgzY4iZHWmIE,93519
|
|
15
15
|
megfile/sftp.py,sha256=uBcLQs-j6Q-q-sWAdd-pgi5Qmb_kq7boJM-0sCfcNO0,26540
|
|
16
16
|
megfile/sftp_path.py,sha256=CgirHWmNdXdqyIL9ufmlaMpwFhlkQVZhqmfvjUaj7qU,43845
|
|
17
|
-
megfile/smart.py,sha256=
|
|
17
|
+
megfile/smart.py,sha256=Miz3jyLKmwWBja-8GrSzrumpTarPrFPqXaFQJKwrK1Y,36627
|
|
18
18
|
megfile/smart_path.py,sha256=Up_6xNZ2019iSzMn_JAU_1H--z-AP6O7SxdXGdeTG0c,7659
|
|
19
19
|
megfile/stdio.py,sha256=ZwxsnJNJYIT7Iyg5pIw4qiyH8bszG6oAhEJuR-hXGG4,658
|
|
20
20
|
megfile/stdio_path.py,sha256=cxaDr8rtisTPnN-rjtaEpqQnshwiqwXFUJBM9xWY7Cg,2711
|
|
21
|
-
megfile/version.py,sha256=
|
|
21
|
+
megfile/version.py,sha256=FceFVYf0TTvPdz_-wQYGd2Nu7cQw9bu1MClPA-Hgh0E,25
|
|
22
22
|
megfile/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
23
|
megfile/lib/base_prefetch_reader.py,sha256=uxVwYknOjc8hLF7q_T2QKMsBqFcrf411ZsuK25CN1eQ,12848
|
|
24
24
|
megfile/lib/combine_reader.py,sha256=Kp2wEloOUpTlIU7dve87MBpSzmIM-F9OtpTawAjFkiU,4828
|
|
@@ -43,10 +43,10 @@ megfile/lib/stdio_handler.py,sha256=IDdgENLQlhigEwkLL4zStueVSzdWg7xVcTF_koof_Ek,
|
|
|
43
43
|
megfile/lib/url.py,sha256=ER32pWy9Q2MAk3TraAaNEBWIqUeBmLuM57ol2cs7-Ks,103
|
|
44
44
|
megfile/utils/__init__.py,sha256=pawmXnCNokWLj338a60b_hK21koYavpEiEohZhsOaGQ,10156
|
|
45
45
|
megfile/utils/mutex.py,sha256=asb8opGLgK22RiuBJUnfsvB8LnMmodP8KzCVHKmQBWA,2561
|
|
46
|
-
megfile-4.1.
|
|
47
|
-
megfile-4.1.
|
|
48
|
-
megfile-4.1.
|
|
49
|
-
megfile-4.1.
|
|
50
|
-
megfile-4.1.
|
|
51
|
-
megfile-4.1.
|
|
52
|
-
megfile-4.1.
|
|
46
|
+
megfile-4.1.8.post1.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
47
|
+
megfile-4.1.8.post1.dist-info/licenses/LICENSE.pyre,sha256=9lf5nT-5ZH25JijpYAequ0bl8E8z5JmZB1qrjiUMp84,1080
|
|
48
|
+
megfile-4.1.8.post1.dist-info/METADATA,sha256=7pRHrmLqja2l5oNGGx19IPRYbM-Z0ruvJ-znSi7NOVQ,9601
|
|
49
|
+
megfile-4.1.8.post1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
50
|
+
megfile-4.1.8.post1.dist-info/entry_points.txt,sha256=M6ZWSSv5_5_QtIpZafy3vq7WuOJ_5dSGQQnEZbByt2Q,49
|
|
51
|
+
megfile-4.1.8.post1.dist-info/top_level.txt,sha256=i3rMgdU1ZAJekAceojhA-bkm3749PzshtRmLTbeLUPQ,8
|
|
52
|
+
megfile-4.1.8.post1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|