We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b39f75 commit 204d11dCopy full SHA for 204d11d
Tests/test_image.py
@@ -160,6 +160,10 @@ def test_set_mode(self) -> None:
160
with pytest.raises(AttributeError):
161
im.mode = "P" # type: ignore[misc]
162
163
+ def test_empty_path(self) -> None:
164
+ with pytest.raises(FileNotFoundError):
165
+ Image.open("")
166
+
167
def test_invalid_image(self) -> None:
168
im = io.BytesIO(b"")
169
with pytest.raises(UnidentifiedImageError):
src/PIL/Image.py
@@ -3510,8 +3510,6 @@ def open(
3510
filename: str | bytes = ""
3511
if is_path(fp):
3512
filename = os.fspath(fp)
3513
-
3514
- if filename:
3515
fp = builtins.open(filename, "rb")
3516
exclusive_fp = True
3517
else:
0 commit comments