incompatible with Python 3.13 due to pgpy dependency using deprecated imghdr module
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
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.
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
- Dominant language
- Python
- Stars
- 24
- Forks
- 42
- Avg merge
- 29m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from CyberSource/cybersource-rest-client-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
CyberSource/cybersource-rest-client-python#177 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
CyberSource/cybersource-rest-client-python#156 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
CyberSource/cybersource-rest-client-python#143 · 1 comment ·
All issues in CyberSource/cybersource-rest-client-python
Similar issues
-
adr
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kristofdegrave/homeassistant-smart-charging#1607 ·
Maintainers usually reply within 1 day
-
namespace operations
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
EclipseFdn/open-vsx.org#13665 ·
Maintainers usually reply within 1 day
-
doc good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
collective/icalendar#1865 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
canonical/opentelemetry-collector-operator#409 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
mozilla/addons-release-tests#1243 ·
Maintainers usually reply within 1 day