CyberSource / CyberSource/cybersource-rest-client-python

Exception: Callable has no attribute __abc_registry

Open
#20 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
24
Forks
42
Avg merge
29m
Merged PRs (30d)
1

Description

Expected Behavior

Cybersource-REST-Client-Python should work with the Python 3.7.

Actual Behavior

Users receive a Callable has no attribute __abc_registry error.

This is a known issue when installing typing on a system that has Python > 3.6 because typing is in the standard library since version 3.5. Importing typing with Python 3.7 fails.

Cloudwatch Log

[ERROR] AttributeError: type object 'Callable' has no attribute '_abc_registry'
Traceback (most recent call last):
  File "/var/lang/lib/python3.7/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/var/lang/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/var/task/app.py", line 4, in <module>
    from typing import Optional
  File "/var/task/typing.py", line 1347, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/var/task/typing.py", line 1003, in __new__
    self._abc_registry = extra._abc_registry

Steps to Reproduce the Problem

  1. Installed the latest available version of the SDK through pip so it will install all required dependencies too.
  2. Create a test.py file and import the Cybersource SDK in an environment with Python > 3.5.
  3. Execute the script python or upload the code to Lambda and run it.

Suggestion for Fix

Opened a PR here: https://github.com/CyberSource/cybersource-rest-client-python/pull/21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by installing the latest SDK with pip and importing the client or typing.Optional from test.py, using Python 3.7 or Lambda as described. Review the dependency behavior and PR #21; done means the SDK imports successfully on Python 3.7 without the Callable __abc_registry error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.