File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import pathlib
18
18
19
+
19
20
class TypesFilenamesError (Exception ):
20
21
pass
21
22
23
+
22
24
def _stringify_path (filepath_or_buffer ):
23
25
"""Attempt to convert a path-like object to a string.
24
26
@@ -41,7 +43,7 @@ def _stringify_path(filepath_or_buffer):
41
43
https://github.com/pandas-dev/pandas/blob/325dd686de1589c17731cf93b649ed5ccb5a99b4/pandas/io/common.py#L131-L160
42
44
"""
43
45
if hasattr (filepath_or_buffer , "__fspath__" ):
44
- return filepath_or_buffer .__fspath__ ()
46
+ return filepath_or_buffer .__fspath__ ()
45
47
elif isinstance (filepath_or_buffer , pathlib .Path ):
46
48
return str (filepath_or_buffer )
47
49
return filepath_or_buffer
@@ -288,7 +290,7 @@ def splitext_addext(filename,
288
290
('fname', '.ext', '.foo')
289
291
'''
290
292
filename = _stringify_path (filename )
291
-
293
+
292
294
if match_case :
293
295
endswith = _endswith
294
296
else :
Original file line number Diff line number Diff line change 20
20
from .deprecated import deprecate_with_version
21
21
22
22
23
-
24
-
25
23
def load (filename , ** kwargs ):
26
24
''' Load file given filename, guessing at file type
27
25
@@ -39,14 +37,14 @@ def load(filename, **kwargs):
39
37
'''
40
38
filename = _stringify_path (filename )
41
39
42
- #Check file exists and is not empty
40
+ # Check file exists and is not empty
43
41
try :
44
42
stat_result = os .stat (filename )
45
43
except OSError :
46
44
raise FileNotFoundError ("No such file or no access: '%s'" % filename )
47
45
if stat_result .st_size <= 0 :
48
46
raise ImageFileError ("Empty file: '%s'" % filename )
49
-
47
+
50
48
sniff = None
51
49
for image_klass in all_image_classes :
52
50
is_valid , sniff = image_klass .path_maybe_image (filename , sniff )
You can’t perform that action at this time.
0 commit comments