Cannot delete custom field in Event doctype

Hey guys,
So I am trying to delete a custom field using the Customise option on the Event doctype.

The error received when trying to save the doctype is this: ImportError: cannot import name FileNotFoundError

Traceback from frappe.log

[ERROR] 2019-10-10 06:19:41,660 | /home/frappe/frappe-bench/apps/frappe/frappe/
Form Dict: {
 "cmd": "runserverobj",
 "docs": "{\"image_view\":0,\"track_changes\":1,\"doctype\":\"Customize Form\",\"sort_order\":\"DESC\",\"editable_grid\":0,\"max_attachments\":0,\"allow_auto_repeat\":0,\"a$
 "method": "save_customization"
Request Error
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 60, in application
    response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 55, in handle
    return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 56, in execute_cmd
    return, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 1036, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 84, in runserverobj
    frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/", line 36, in runserverobj
    except ValueError:
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 786, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 1056, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 1039, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 780, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/customize_form/", line 167, in save_customization
  File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/customize_form/", line 259, in update_custom_fields
  File "/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/customize_form/", line 314, in delete_custom_fields
    frappe.delete_doc("Custom Field",
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 775, in delete_doc
    import frappe.model.delete_doc
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 19, in <module>
    from frappe.exceptions import FileNotFoundError
ImportError: cannot import name FileNotFoundError

Guys, I really need your help with this… the problem is still there.

I cannot delete custom fields … anyone else experiencing this ?

can you share a screenshot when does error raise!

the error is import Error, cannot import name FileNotFoundError
on line 19 from frappe.exceptions import FileNotFoundError

the strange thing is when run the same on bench console there is no error


and after changed the code in as following(copied the FileNotFoundError declaration from the original


error fixed, but I have no idea WHY.