Commit 878fb933 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

load_graph_from_csv(): Fix loading from compressed files with Python 3

This fixes issue #593
parent 354c0a1a
......@@ -3334,13 +3334,13 @@ def load_graph_from_csv(file_name, directed=False, eprop_types=None,
if isinstance(file_name, (str, unicode)):
if file_name.endswith(".xz"):
file_name =, mode="r")
file_name =, mode="rt")
except ImportError:
raise NotImplementedError("lzma compression is only available in Python >= 3.3")
elif file_name.endswith(".gz"):
file_name =, mode="r")
file_name =, mode="rt")
elif file_name.endswith(".bz2"):
file_name =, mode="r")
file_name =, mode="rt")
file_name = open(file_name, "r")
_csv_options = {"delimiter": ",", "quotechar": '"'}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment