Bench execute download_template -> 'AttributeError: module 'frappe' has no attribute 'permissions'

Hello,
I’m trying to use bench execute command to download an import template. I’d like to get the new template, ‘bench export-csv’ seems to use the old format.

bench --site mysite.localhost execute --args "['My Document']" --kwargs "{'export_records':'All', 'export_fields':{} }" frappe.core.doctype.data_import.data_import.download_template

I’m getting an exception I can’t fix and feel like I am missing something simple:

Traceback (most recent call last):
  File "/workspace/frappe-bench/apps/frappe/frappe/commands/utils.py", line 280, in execute
    ret = frappe.get_attr(method)(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/frappe-bench/apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py", line 171, in download_template
    e = Exporter(
        ^^^^^^^^^
  File "/workspace/frappe-bench/apps/frappe/frappe/core/doctype/data_import/exporter.py", line 50, in __init__
    self.add_data()
  File "/workspace/frappe-bench/apps/frappe/frappe/core/doctype/data_import/exporter.py", line 227, in add_data
    self.csv_array += self.data
  File "/workspace/frappe-bench/apps/frappe/frappe/core/doctype/data_import/exporter.py", line 113, in get_data_to_export
    frappe.permissions.can_export(self.doctype, raise_exception=True)
    ^^^^^^^^^^^^^^^^^^
AttributeError: module 'frappe' has no attribute 'permissions'

I’m running inside a docker container using an interactive shell attached to the backend if that matters.

I’m guessing the bench user doesn’t have a User ID or something like that and failing the permissions check.

Anyone have any ideas or another way to automate downloading a template?

Thanks,
Derek