File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def report_completion(self, runtime):
9999class EntityFile (object ):
100100 def __init__ (self , filename ):
101101 # The label or relation type string is the basename of the file
102- self .entity_str = os .path .splitext (os .path .basename (filename ))[0 ]. encode ()
102+ self .entity_str = os .path .splitext (os .path .basename (filename ))[0 ]
103103 # Input file handling
104104 self .infile = io .open (filename , 'rt' )
105105 # Initialize CSV reader that ignores leading whitespace in each field
@@ -140,8 +140,9 @@ def reset_partial_binary(self):
140140 def pack_header (self , header ):
141141 prop_count = len (header ) - self .prop_offset
142142 # String format
143- fmt = "=%dsI" % (len (self .entity_str ) + 1 ) # Unaligned native, entity_string, count of properties
144- args = [self .entity_str , prop_count ]
143+ entity_bytes = self .entity_str .encode ()
144+ fmt = "=%dsI" % (len (entity_bytes ) + 1 ) # Unaligned native, entity name, count of properties
145+ args = [entity_bytes , prop_count ]
145146 for p in header [self .prop_offset :]:
146147 prop = p .encode ()
147148 fmt += "%ds" % (len (prop ) + 1 ) # encode string with a null terminator
You can’t perform that action at this time.
0 commit comments