Installing v10: TypeError: a bytes-like object is required, not 'list'

Installing frappe...
Updating DocTypes for frappe        : [===================                     ]Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/diksha/v10/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/diksha/v10/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/diksha/v10/env/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/diksha/v10/env/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/diksha/v10/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/diksha/v10/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/diksha/v10/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/diksha/v10/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/diksha/v10/apps/frappe/frappe/commands/site.py", line 34, in new_site
    verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
  File "/home/diksha/v10/apps/frappe/frappe/commands/site.py", line 69, in _new_site
    _install_app(app, verbose=verbose, set_as_patched=not source_sql)
  File "/home/diksha/v10/apps/frappe/frappe/installer.py", line 141, in install_app
    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
  File "/home/diksha/v10/apps/frappe/frappe/model/sync.py", line 45, in sync_for
    reset_permissions=reset_permissions, for_sync=True)
  File "/home/diksha/v10/apps/frappe/frappe/modules/import_file.py", line 58, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/diksha/v10/apps/frappe/frappe/modules/import_file.py", line 132, in import_doc
    doc.insert()
  File "/home/diksha/v10/apps/frappe/frappe/model/document.py", line 248, in insert
    self.run_post_save_methods()
  File "/home/diksha/v10/apps/frappe/frappe/model/document.py", line 889, in run_post_save_methods
    self.run_method("on_update")
  File "/home/diksha/v10/apps/frappe/frappe/model/document.py", line 757, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/diksha/v10/apps/frappe/frappe/model/document.py", line 1026, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/diksha/v10/apps/frappe/frappe/model/document.py", line 1009, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/diksha/v10/apps/frappe/frappe/model/document.py", line 751, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/diksha/v10/apps/frappe/frappe/website/doctype/website_theme/website_theme.py", line 21, in on_update
    self.clear_cache_if_current_theme()
  File "/home/diksha/v10/apps/frappe/frappe/website/doctype/website_theme/website_theme.py", line 50, in clear_cache_if_current_theme
    website_settings = frappe.get_doc("Website Settings", "Website Settings")
  File "/home/diksha/v10/apps/frappe/frappe/__init__.py", line 638, in get_doc
    return frappe.model.document.get_doc(*args, **kwargs)
  File "/home/diksha/v10/apps/frappe/frappe/model/document.py", line 68, in get_doc
    return controller(*args, **kwargs)
  File "/home/diksha/v10/apps/frappe/frappe/model/document.py", line 103, in __init__
    self.load_from_db()
  File "/home/diksha/v10/apps/frappe/frappe/model/document.py", line 129, in load_from_db
    single_doc = frappe.new_doc(self.doctype).as_dict()
  File "/home/diksha/v10/apps/frappe/frappe/__init__.py", line 614, in new_doc
    return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
  File "/home/diksha/v10/apps/frappe/frappe/model/create_new.py", line 20, in get_new_doc
    frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
  File "/home/diksha/v10/apps/frappe/frappe/model/create_new.py", line 41, in make_new_doc
    set_user_and_static_default_values(doc)
  File "/home/diksha/v10/apps/frappe/frappe/model/create_new.py", line 51, in set_user_and_static_default_values
    user_permissions = get_user_permissions()
  File "/home/diksha/v10/apps/frappe/frappe/core/doctype/user_permission/user_permission.py", line 67, in get_user_permissions
    fields=['allow', 'for_value'], filters=dict(user=user)):
  File "/home/diksha/v10/apps/frappe/frappe/__init__.py", line 1177, in get_all
    return get_list(doctype, *args, **kwargs)
  File "/home/diksha/v10/apps/frappe/frappe/__init__.py", line 1150, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
  File "/home/diksha/v10/apps/frappe/frappe/model/db_query.py", line 90, in execute
    result = self.build_and_run()
  File "/home/diksha/v10/apps/frappe/frappe/model/db_query.py", line 102, in build_and_run
    args = self.prepare_args()
  File "/home/diksha/v10/apps/frappe/frappe/model/db_query.py", line 125, in prepare_args
    self.build_conditions()
  File "/home/diksha/v10/apps/frappe/frappe/model/db_query.py", line 310, in build_conditions
    self.build_filter_conditions(self.filters, self.conditions)
  File "/home/diksha/v10/apps/frappe/frappe/model/db_query.py", line 331, in build_filter_conditions
    conditions.append(self.prepare_filter_condition(f))
  File "/home/diksha/v10/apps/frappe/frappe/model/db_query.py", line 402, in prepare_filter_condition
    value = '"{0}"'.format(frappe.db.escape(value, percent=False))
  File "/home/diksha/v10/apps/frappe/frappe/database.py", line 911, in escape
    s = text_type(pymysql.escape_string(s), "utf-8").replace("`", "\\`")
  File "/home/diksha/v10/env/lib/python3.6/site-packages/pymysql/converters.py", line 73, in _escape_unicode
    return value.translate(_escape_table)
TypeError: a bytes-like object is required, not 'list'

I just created a v10.x.x bench and was trying to create a site for which I got the above error.
Things tried so far: switched to the apps folders(frappe and erpnext) and did find . -name "*.pyc" -exec rm -f {} \; assuming it might a problem with the python versions. But it didn’t work. I have also tried updating the bench, no difference.

Can anyone please help?

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.