From c28fdbe2b26681a04d8218f0bbc7aaa65ffdbb94 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Wed, 23 Mar 2022 11:58:12 +0530 Subject: [PATCH] updated --- rog/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rog/models.py b/rog/models.py index 793f690..36b7495 100644 --- a/rog/models.py +++ b/rog/models.py @@ -327,7 +327,7 @@ def remove_bom_inplace(path): buffer_size = 4096 bom_length = len(codecs.BOM_UTF8) - with open(path, mode="r+b", encoding="utf-8") as fp: + with open(path, mode="r+b") as fp: chunk = fp.read(buffer_size) if chunk.startswith(codecs.BOM_UTF8): i = 0 @@ -382,7 +382,7 @@ def publish_date(sender, instance, created, **kwargs): try: csv_f = glob.glob(r'{}/**/*.csv'.format(file_path), recursive=True)[0] - #remove_bom_inplace(csv_f) + remove_bom_inplace(csv_f) mdl = apps.get_model(app_label="rog", model_name=LAYER_CHOICES[instance.layerof -1][1]) print(mdl)