File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -714,7 +714,7 @@ def get_handle(
714
714
assert not isinstance (handle , str )
715
715
handles .append (handle )
716
716
717
- elif is_path :
717
+ elif isinstance ( handle , str ) :
718
718
# Check whether the filename is to be opened in binary mode.
719
719
# Binary mode does not support 'encoding' and 'newline'.
720
720
if ioargs .encoding and "b" not in ioargs .mode :
Original file line number Diff line number Diff line change 5
5
StringIO ,
6
6
)
7
7
import os
8
+ from pathlib import Path
8
9
9
10
import numpy as np
10
11
import pytest
@@ -202,14 +203,14 @@ def test_str_output(datapath, parser):
202
203
203
204
204
205
def test_wrong_file_path (parser ):
205
- fpath = "/my/fake/path/output.xml"
206
- dirname = os . path . dirname ( fpath )
206
+ path = "/my/fake/path/output.xml"
207
+ parent = Path ( path ). parent
207
208
208
209
with pytest .raises (
209
210
OSError ,
210
- match = (fr"Cannot save file into a non-existent directory: '{ dirname } '" ),
211
+ match = (fr"Cannot save file into a non-existent directory: '{ parent } '" ),
211
212
):
212
- geom_df .to_xml (fpath , parser = parser )
213
+ geom_df .to_xml (path , parser = parser )
213
214
214
215
215
216
# INDEX
You can’t perform that action at this time.
0 commit comments