Skip to content

Commit 0e084d8

Browse files
committed
fix not use imghdr. NoneSplitter file read mode r+b.
1 parent 19794bc commit 0e084d8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/sagemaker/local/data.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import platform
1818
import sys
1919
import tempfile
20-
import imghdr
21-
2220
from abc import ABCMeta
2321
from abc import abstractmethod
2422
from six import with_metaclass
@@ -235,8 +233,7 @@ def split(self, file):
235233
Returns: generator for the individual records that were split from
236234
the file
237235
"""
238-
mode = "r" if imghdr.what(file) is None else "rb"
239-
with open(file, mode) as f:
236+
with open(file, "r+b") as f:
240237
yield f.read()
241238

242239

0 commit comments

Comments
 (0)