Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorizenet dependency is incompatible with Python 3.11+ #39

Open
Alchez opened this issue Dec 4, 2024 · 0 comments
Open

Authorizenet dependency is incompatible with Python 3.11+ #39

Alchez opened this issue Dec 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Alchez
Copy link
Collaborator

Alchez commented Dec 4, 2024

Dependency:
https://github.com/agritheory/authorizenet (creating the ticket here since I can't do it in the dependency itself)

Problem:
Since SafeConfigParser has been deprecated in Python 3.11, trying to install this app in a py3.11 environment fails.

Solution:
We could try sync the dependency's changes with it's origin, which will access the correct parser.


Traceback:

Traceback (most recent call last):
  File "/apps/frappe/frappe/modules/utils.py", line 254, in load_doctype_module
    doctype_python_modules[key] = frappe.get_module(module_name)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/__init__.py", line 1433, in get_module
    return importlib.import_module(modulename)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/apps/electronic_payments/electronic_payments/electronic_payments/doctype/electronic_payment_settings/electronic_payment_settings.py", line 5, in <module>
    from electronic_payments.electronic_payments.doctype.electronic_payment_settings.authorize import (
  File "/apps/electronic_payments/electronic_payments/electronic_payments/doctype/electronic_payment_settings/authorize.py", line 12, in <module>
    from authorizenet.apicontrollers import (
  File "/env/lib/python3.12/site-packages/authorizenet/apicontrollers.py", line 9, in <module>
    from authorizenet import apicontrollersbase   
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/env/lib/python3.12/site-packages/authorizenet/apicontrollersbase.py", line 16, in <module>
    from authorizenet import utility
  File "/env/lib/python3.12/site-packages/authorizenet/utility.py", line 11, in <module>
    from configparser import SafeConfigParser
ImportError: cannot import name 'SafeConfigParser' from 'configparser' (/usr/lib/python3.12/configparser.py). Did you mean: 'RawConfigParser'?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/env/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/env/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/env/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/env/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/env/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/env/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/env/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/commands/site.py", line 689, in migrate
    ).run(site=site)
      ^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/migrate.py", line 186, in run
    self.run_schema_updates()
  File "/apps/frappe/frappe/migrate.py", line 52, in wrapper
    raise e
  File "/apps/frappe/frappe/migrate.py", line 44, in wrapper
    ret = method(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/migrate.py", line 117, in run_schema_updates
    frappe.modules.patch_handler.run_all(
  File "/apps/frappe/frappe/modules/patch_handler.py", line 76, in run_all
    run_patch(patch)
  File "/apps/frappe/frappe/modules/patch_handler.py", line 62, in run_patch
    if not run_single(patchmodule=patch):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/modules/patch_handler.py", line 152, in run_single
    return execute_patch(patchmodule, method, methodargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/modules/patch_handler.py", line 188, in execute_patch
    _patch()
  ... stubbed ...
    install_app("electronic_payments")
  File "/apps/frappe/frappe/installer.py", line 316, in install_app
    sync_for(name, force=force, reset_permissions=True)
  File "/apps/frappe/frappe/model/sync.py", line 111, in sync_for
    import_file_by_path(
  File "/apps/frappe/frappe/modules/import_file.py", line 146, in import_file_by_path
    import_doc(
  File "/apps/frappe/frappe/modules/import_file.py", line 239, in import_doc
    doc.insert()
  File "/apps/frappe/frappe/model/document.py", line 320, in insert
    self.run_post_save_methods()
  File "/apps/frappe/frappe/model/document.py", line 1140, in run_post_save_methods
    self.run_method("on_update")
  File "/apps/frappe/frappe/model/document.py", line 974, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/model/document.py", line 1334, in composer
    return composed(self, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/model/document.py", line 1316, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/model/document.py", line 971, in fn
    return method_object(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 531, in on_update
    self.run_module_method("on_doctype_update")
  File "/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 629, in run_module_method
    module = load_doctype_module(self.name, self.module)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/frappe/frappe/modules/utils.py", line 258, in load_doctype_module
    raise ImportError(msg) from e
ImportError: Module import failed for Electronic Payment Settings, the DocType you're trying to open might be deleted.
Error: cannot import name 'SafeConfigParser' from 'configparser' (/usr/lib/python3.12/configparser.py)
@Alchez Alchez added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants