We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4e8f81 commit 0acd200Copy full SHA for 0acd200
2 files changed
pkg/pyproject.toml
@@ -15,6 +15,6 @@ namespaces = true
15
16
# ----------------------------------------- Project Metadata -------------------------------------
17
[project]
18
-version = "0.2.9"
+version = "0.2.10"
19
name = "FileEx"
20
requires-python = ">=3.10"
pkg/src/fileex/file.py
@@ -146,7 +146,9 @@ def return_from_str(s: str) -> str | bytes:
146
# String: check if path or content
147
if isinstance(file, str):
148
if path_can_be_str and fileex.path.is_path(file):
149
- return return_from_bytes(Path(file).read_bytes())
+ filepath = Path(file)
150
+ if filepath.is_file():
151
+ return return_from_bytes(filepath.read_bytes())
152
return return_from_str(file)
153
154
# Bytes-like: normalize to bytes
0 commit comments