@@ -365,13 +365,13 @@ def utils_load_JSON_file(json_filename, default_obj = {}, verbose = True):
365365# Note that there is a bug in the json module where the ensure_ascii=False flag can produce
366366# a mix of unicode and str objects.
367367# See http://stackoverflow.com/questions/18337407/saving-utf-8-texts-in-json-dumps-as-utf8-not-as-u-escape-sequence
368- def utils_write_JSON_file (json_filename , json_data , verbose = True , pprint = False , lowmem = False ):
368+ def utils_write_JSON_file (json_filename , json_data , verbose = True , pprint = False ):
369369 l_start = time .time ()
370370 if verbose : log_debug ('utils_write_JSON_file() "{}"' .format (json_filename ))
371371
372372 # Choose JSON iterative encoder or normal encoder.
373- if lowmem :
374- if verbose : log_debug ('utils_write_JSON_file() Using lowmem option' )
373+ if OPTION_LOWMEM_WRITE_JSON :
374+ if verbose : log_debug ('utils_write_JSON_file() Using OPTION_LOWMEM_WRITE_JSON option' )
375375 if pprint :
376376 jobj = json .JSONEncoder (ensure_ascii = False , sort_keys = True ,
377377 indent = JSON_INDENT , separators = JSON_SEP )
@@ -396,7 +396,7 @@ def utils_write_JSON_file(json_filename, json_data, verbose = True, pprint = Fal
396396 # Write JSON to disk
397397 try :
398398 with io .open (json_filename , 'wt' , encoding = 'utf-8' ) as file :
399- if lowmem :
399+ if OPTION_LOWMEM_WRITE_JSON :
400400 # Chunk by chunk JSON writer, uses less memory but takes longer.
401401 for chunk in jobj .iterencode (json_data ):
402402 file .write (text_type (chunk ))
0 commit comments