From d747facccbe835be1384e569cf3d6e4c335c0364 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 15 Jan 2020 10:23:58 +0100 Subject: In python2, does not work. is ok for Python 2 and 3 --- src/python/gudhi/nerve_gic.pyx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/python/gudhi/nerve_gic.pyx') diff --git a/src/python/gudhi/nerve_gic.pyx b/src/python/gudhi/nerve_gic.pyx index 68c06432..382e71c5 100644 --- a/src/python/gudhi/nerve_gic.pyx +++ b/src/python/gudhi/nerve_gic.pyx @@ -180,7 +180,7 @@ cdef class CoverComplex: :returns: Read file status. """ if os.path.isfile(off_file): - return self.thisptr.read_point_cloud(str.encode(off_file)) + return self.thisptr.read_point_cloud(off_file.encode('utf-8')) else: print("file " + off_file + " not found.") return False @@ -212,7 +212,7 @@ cdef class CoverComplex: :type color_file_name: string """ if os.path.isfile(color_file_name): - self.thisptr.set_color_from_file(str.encode(color_file_name)) + self.thisptr.set_color_from_file(color_file_name.encode('utf-8')) else: print("file " + color_file_name + " not found.") @@ -233,7 +233,7 @@ cdef class CoverComplex: :type cover_file_name: string """ if os.path.isfile(cover_file_name): - self.thisptr.set_cover_from_file(str.encode(cover_file_name)) + self.thisptr.set_cover_from_file(cover_file_name.encode('utf-8')) else: print("file " + cover_file_name + " not found.") @@ -266,7 +266,7 @@ cdef class CoverComplex: :type func_file_name: string """ if os.path.isfile(func_file_name): - self.thisptr.set_function_from_file(str.encode(func_file_name)) + self.thisptr.set_function_from_file(func_file_name.encode('utf-8')) else: print("file " + func_file_name + " not found.") @@ -307,7 +307,7 @@ cdef class CoverComplex: :type graph_file_name: string """ if os.path.isfile(graph_file_name): - self.thisptr.set_graph_from_file(str.encode(graph_file_name)) + self.thisptr.set_graph_from_file(graph_file_name.encode('utf-8')) else: print("file " + graph_file_name + " not found.") @@ -368,7 +368,7 @@ cdef class CoverComplex: :param type: either "GIC" or "Nerve". :type type: string """ - self.thisptr.set_type(str.encode(type)) + self.thisptr.set_type(type.encode('utf-8')) def set_verbose(self, verbose): """Specifies whether the program should display information or not. -- cgit v1.2.3