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 ad2e98c commit f59fdb5Copy full SHA for f59fdb5
pandas/io/packers.py
@@ -184,6 +184,8 @@ def read(fh):
184
if exists:
185
with open(path_or_buf, 'rb') as fh:
186
return read(fh)
187
+ else:
188
+ return FileNotFoundError('{} not found'.format(path_or_buf))
189
190
if isinstance(path_or_buf, bytes):
191
# treat as a binary-like
pandas/tests/io/test_packers.py
@@ -934,3 +934,7 @@ def test_msgpack_period_freq(self):
934
s = Series(np.random.rand(5), index=date_range('20130101', periods=5))
935
r = read_msgpack(s.to_msgpack())
936
repr(r)
937
+
938
+ def test_msgpack_file_not_found(self):
939
+ bad_path = '1/2/3/4/path/does/not/exist'
940
+ pytest.raises(read_msgpack, FileNotFoundError, bad_path)
0 commit comments