CyberSource / CyberSource/cybersource-rest-client-python
incompatible with Python 3.13 due to pgpy dependency using deprecated imghdr module
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24
- Forks
- 42
- Avg merge
- 29m
- Merged PRs (30d)
- 1
Description
The cybersource-rest-client-python package fails to initialize on Python 3.13 due to a transitive dependency issue with the pgpy package.
See also: https://github.com/SecurityInnovation/PGPy/issues/462
Environment
- Package version: 0.0.70 (latest)
- Python version: 3.13.x
- Operating System: All platforms
Root Cause
- Python 3.13 removed the deprecated
imghdrmodule (https://peps.python.org/pep-0594/) - The
pgpypackage (v0.6.0) importsimghdrin itsconstants.pyfile cybersource-rest-client-pythondepends onpgpy(defined insetup.py)BatchUploadWithMTLSApiis imported in the top-levelCyberSource/__init__.py- This triggers the import chain: CyberSource → BatchUploadWithMTLSApi → PgpEncryption → pgpy → imghdr ❌
Error Traceback
import CyberSource
File "/site-packages/CyberSource/__init__.py", line 1559, in <module>
from .api.o_auth_api import OAuthApi
File "/site-packages/CyberSource/api/__init__.py", line 5, in <module>
from .batch_upload_with_mtls_api import BatchUploadWithMTLSApi
File "/site-packages/CyberSource/api/batch_upload_with_mtls_api.py", line 6, in <module>
from CyberSource.utilities.pgpBatchUpload.pgp_encryption import PgpEncryption
File "/site-packages/CyberSource/utilities/pgpBatchUpload/pgp_encryption.py", line 4, in <module>
import pgpy
File "/site-packages/pgpy/__init__.py", line 4, in <module>
from .pgp import PGPKey
File "/site-packages/pgpy/pgp.py", line 25, in <module>
from .constants import CompressionAlgorithm
File "/site-packages/pgpy/constants.py", line 5, in <module>
import imghdr
ModuleNotFoundError: No module named 'imghdr'
Impact
- Blocks Python 3.13 adoption for all users of this package
- Affects all users, even those not using batch upload functionality, because the import happens at package initialization
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with setup.py and the import chain through CyberSource/init.py, CyberSource/api/batch_upload_with_mtls_api.py, and CyberSource/utilities/pgpBatchUpload/pgp_encryption.py. Reproduce the top-level import on Python 3.13 and determine the smallest supported dependency or import change; done means the package initializes without the shown ModuleNotFoundError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100