This commit is contained in:
Mohamed Nouffer
2022-03-23 11:48:11 +05:30
parent 808e1fc74f
commit cb5a5b6659

View File

@ -327,7 +327,7 @@ def remove_bom_inplace(path):
buffer_size = 4096
bom_length = len(codecs.BOM_UTF8)
with open(path, "r+b") as fp:
with open(path, mode="r+b", encoding="utf-8") 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)