python-fsutil 0.15.0__py3-none-any.whl → 0.16.0__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.
- fsutil/io.py +7 -7
- fsutil/metadata.py +1 -1
- fsutil/operations.py +2 -0
- {python_fsutil-0.15.0.dist-info → python_fsutil-0.16.0.dist-info}/METADATA +7 -6
- {python_fsutil-0.15.0.dist-info → python_fsutil-0.16.0.dist-info}/RECORD +8 -8
- {python_fsutil-0.15.0.dist-info → python_fsutil-0.16.0.dist-info}/WHEEL +1 -1
- {python_fsutil-0.15.0.dist-info → python_fsutil-0.16.0.dist-info/licenses}/LICENSE.txt +0 -0
- {python_fsutil-0.15.0.dist-info → python_fsutil-0.16.0.dist-info}/top_level.txt +0 -0
fsutil/io.py
CHANGED
|
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
4
|
import os
|
|
5
|
-
import platform
|
|
6
5
|
import tempfile
|
|
7
6
|
from collections.abc import Generator
|
|
8
7
|
from datetime import datetime
|
|
@@ -137,12 +136,12 @@ def _write_file_atomic(
|
|
|
137
136
|
if append:
|
|
138
137
|
content = read_file(path, encoding=encoding) + content
|
|
139
138
|
dirpath, _ = split_filepath(path)
|
|
140
|
-
|
|
139
|
+
temp_path = None
|
|
141
140
|
try:
|
|
142
141
|
with tempfile.NamedTemporaryFile(
|
|
143
142
|
mode=mode,
|
|
144
143
|
dir=dirpath,
|
|
145
|
-
delete=
|
|
144
|
+
delete=False,
|
|
146
145
|
# delete_on_close=False, # supported since Python >= 3.12
|
|
147
146
|
encoding=encoding,
|
|
148
147
|
) as file:
|
|
@@ -150,10 +149,11 @@ def _write_file_atomic(
|
|
|
150
149
|
file.flush()
|
|
151
150
|
os.fsync(file.fileno())
|
|
152
151
|
temp_path = file.name
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
152
|
+
# file is now closed, safe to replace on Windows
|
|
153
|
+
permissions = get_permissions(path) if exists(path) else None
|
|
154
|
+
os.replace(temp_path, path)
|
|
155
|
+
if permissions:
|
|
156
|
+
set_permissions(path, permissions)
|
|
157
157
|
except FileNotFoundError:
|
|
158
158
|
# success - the NamedTemporaryFile has not been able
|
|
159
159
|
# to remove the temp file on __exit__ because the temp file
|
fsutil/metadata.py
CHANGED
fsutil/operations.py
CHANGED
|
@@ -517,6 +517,8 @@ def _search_paths(path: PathIn, pattern: str) -> list[str]:
|
|
|
517
517
|
assert_dir(path)
|
|
518
518
|
pathname = os.path.join(path, pattern)
|
|
519
519
|
paths = glob.glob(pathname, recursive=True)
|
|
520
|
+
# normalize paths to use OS-specific separators
|
|
521
|
+
paths = [os.path.normpath(path_result) for path_result in paths]
|
|
520
522
|
return paths
|
|
521
523
|
|
|
522
524
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: python-fsutil
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: high-level file-system operations for lazy devs.
|
|
5
5
|
Author-email: Fabio Caccamo <fabio.caccamo@gmail.com>
|
|
6
6
|
Maintainer-email: Fabio Caccamo <fabio.caccamo@gmail.com>
|
|
@@ -46,6 +46,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
46
46
|
Classifier: Programming Language :: Python :: 3.11
|
|
47
47
|
Classifier: Programming Language :: Python :: 3.12
|
|
48
48
|
Classifier: Programming Language :: Python :: 3.13
|
|
49
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
49
50
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
50
51
|
Classifier: Topic :: Desktop Environment :: File Managers
|
|
51
52
|
Classifier: Topic :: Software Development :: Build Tools
|
|
@@ -54,6 +55,7 @@ Classifier: Topic :: System :: Filesystems
|
|
|
54
55
|
Classifier: Topic :: Utilities
|
|
55
56
|
Description-Content-Type: text/markdown
|
|
56
57
|
License-File: LICENSE.txt
|
|
58
|
+
Dynamic: license-file
|
|
57
59
|
|
|
58
60
|
[](https://www.python.org/)
|
|
59
61
|
[](https://pypi.org/project/python-fsutil/)
|
|
@@ -65,7 +67,6 @@ License-File: LICENSE.txt
|
|
|
65
67
|
[](https://github.com/fabiocaccamo/python-fsutil)
|
|
66
68
|
[](https://codecov.io/gh/fabiocaccamo/python-fsutil)
|
|
67
69
|
[](https://www.codacy.com/app/fabiocaccamo/python-fsutil)
|
|
68
|
-
[](https://codeclimate.com/github/fabiocaccamo/python-fsutil/)
|
|
69
70
|
[](https://github.com/psf/black)
|
|
70
71
|
[](https://github.com/astral-sh/ruff)
|
|
71
72
|
|
|
@@ -825,8 +826,8 @@ pre-commit install --install-hooks
|
|
|
825
826
|
# run tests using tox
|
|
826
827
|
tox
|
|
827
828
|
|
|
828
|
-
# or run tests using
|
|
829
|
-
|
|
829
|
+
# or run tests using pytest
|
|
830
|
+
pytest
|
|
830
831
|
```
|
|
831
832
|
|
|
832
833
|
## License
|
|
@@ -838,7 +839,7 @@ Released under [MIT License](LICENSE.txt).
|
|
|
838
839
|
|
|
839
840
|
- :star: Star this project on [GitHub](https://github.com/fabiocaccamo/python-fsutil)
|
|
840
841
|
- :octocat: Follow me on [GitHub](https://github.com/fabiocaccamo)
|
|
841
|
-
- :blue_heart: Follow me on [
|
|
842
|
+
- :blue_heart: Follow me on [Bluesky](https://bsky.app/profile/fabiocaccamo.bsky.social)
|
|
842
843
|
- :moneybag: Sponsor me on [Github](https://github.com/sponsors/fabiocaccamo)
|
|
843
844
|
|
|
844
845
|
## See also
|
|
@@ -5,15 +5,15 @@ fsutil/checks.py,sha256=LZHz3GsihLlat8Lz-CqQngXDEZfAidmxf8veu_de96I,2807
|
|
|
5
5
|
fsutil/converters.py,sha256=7YoaIg-_XuYzXo0IhjEAZUWasaIbPA67aAL5z_T3IRg,1013
|
|
6
6
|
fsutil/deps.py,sha256=-7eswE7fgHCmILC6GSLbipbuXp_aB3UfmkNRRGaHfgA,336
|
|
7
7
|
fsutil/info.py,sha256=yVoWPtAc_WOj0WVpRIGkq0TTj8xB6W4l-mVUKaB7Bu8,5333
|
|
8
|
-
fsutil/io.py,sha256=
|
|
9
|
-
fsutil/metadata.py,sha256=
|
|
10
|
-
fsutil/operations.py,sha256=
|
|
8
|
+
fsutil/io.py,sha256=1AYC83lhwgNUFiT0BB-I0sDvncXAPopOtlYxzL0lEE4,6327
|
|
9
|
+
fsutil/metadata.py,sha256=gZcEc5XoiEDgf0nxjvOrL1ZP1-9_4rLYdezlOdDGAnk,266
|
|
10
|
+
fsutil/operations.py,sha256=J9LuM5GfkAM13lyPs-S6Ez79vWn6SgQSX5feEYX4MHE,15355
|
|
11
11
|
fsutil/paths.py,sha256=oxeJQgDJlU7a3xu9tThAhQw4LjxHQDjfmYkAcH6B784,5816
|
|
12
12
|
fsutil/perms.py,sha256=Yw0R3w-Bx94bek2sY8FlJ0KI6LGFPpxEpQ3n2ULOmos,669
|
|
13
13
|
fsutil/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
fsutil/types.py,sha256=scqjRct7dMNTmk_UgL1PMxRQktlnEMlSgvOy0MfqREg,111
|
|
15
|
-
python_fsutil-0.
|
|
16
|
-
python_fsutil-0.
|
|
17
|
-
python_fsutil-0.
|
|
18
|
-
python_fsutil-0.
|
|
19
|
-
python_fsutil-0.
|
|
15
|
+
python_fsutil-0.16.0.dist-info/licenses/LICENSE.txt,sha256=IcPfOD_lonKcLMnPRhiWdQUPW_LYW-5TTDljwi3UXQg,1078
|
|
16
|
+
python_fsutil-0.16.0.dist-info/METADATA,sha256=3ST0WCkGwoSBbj22dyvbKzXmhP9b-ysGaICvsyI2zR4,24763
|
|
17
|
+
python_fsutil-0.16.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
18
|
+
python_fsutil-0.16.0.dist-info/top_level.txt,sha256=KGTSjNLPWmxnZt8BFMZQrpnhkO7DsKrYWoXK-Sf3wBQ,7
|
|
19
|
+
python_fsutil-0.16.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|