Explorar el Código

Fix loading of CSV files with BOM

kkthxbye-code hace 3 años
padre
commit
f698c42c41
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      netbox/utilities/forms/forms.py

+ 1 - 1
netbox/utilities/forms/forms.py

@@ -180,7 +180,7 @@ class ImportForm(BootstrapMixin, forms.Form):
         if 'data_file' in self.files:
             self.data_field = 'data_file'
             file = self.files.get('data_file')
-            data = file.read().decode('utf-8')
+            data = file.read().decode('utf-8-sig')
         else:
             data = self.cleaned_data['data']