updated
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user