File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 32
32
file_exists ,
33
33
get_handle ,
34
34
infer_compression ,
35
+ is_file_like ,
35
36
is_fsspec_url ,
36
37
is_url ,
37
38
stringify_path ,
@@ -898,6 +899,7 @@ def read_xml(
898
899
899
900
.. deprecated:: 2.1.0
900
901
Passing html literal strings is deprecated.
902
+ Wrap literal xml input in ``io.StringIO`` or ``io.BytesIO`` instead.
901
903
902
904
xpath : str, optional, default './\*'
903
905
The XPath to parse required set of nodes for migration to DataFrame.
@@ -1125,7 +1127,13 @@ def read_xml(
1125
1127
"""
1126
1128
check_dtype_backend (dtype_backend )
1127
1129
1128
- if isinstance (path_or_buffer , str ) and "\n " in path_or_buffer :
1130
+ if (
1131
+ isinstance (path_or_buffer , str )
1132
+ and not is_file_like (path_or_buffer )
1133
+ and "\n " in path_or_buffer
1134
+ ):
1135
+ with open ("/home/richard/Desktop/file.txt" , "a+" ) as fil :
1136
+ fil .write (f"{ path_or_buffer } \n \n \n " )
1129
1137
warnings .warn (
1130
1138
"Passing literal xml to 'read_xml' is deprecated and "
1131
1139
"will be removed in a future version. To read from a "
You can’t perform that action at this time.
0 commit comments