Skip to content

Commit cb94060

Browse files
committed
add isinstance to filter on str inputs only
1 parent f05dec5 commit cb94060

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/io/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def infer_compression(
584584
# Infer compression
585585
if compression == "infer":
586586
# Convert all path types (e.g. pathlib.Path) to strings
587-
if "::" in filepath_or_buffer:
587+
if isinstance(filepath_or_buffer, str) and "::" in filepath_or_buffer:
588588
# chained URLs contain ::
589589
filepath_or_buffer = filepath_or_buffer.split("::")[0]
590590
filepath_or_buffer = stringify_path(filepath_or_buffer, convert_file_like=True)

0 commit comments

Comments
 (0)