CyberSource / CyberSource/cybersource-rest-client-python

ast.literal_eval crash when log_config is not provided

Open Beginner friendly
#182 0 comments 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

When no log_config is passed, the SDK creates a default LogConfiguration
with enable_log=True, then calls ast.literal_eval(json.dumps(details))
where details contains non-serializable Python objects, causing:

malformed node or string on line 1: <ast.Name object at 0x...>

Path: authenticationsdk/core/MerchantConfiguration.py ~line 401

Fix: either skip the literal_eval (just use json.dumps directly for logging),
or default enable_log to False when no log_config is provided.

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

Start in authenticationsdk/core/MerchantConfiguration.py around line 401. Reproduce the no-log_config path and inspect how the default LogConfiguration, details, and ast.literal_eval interact. Done means the SDK no longer raises the malformed-node error when log_config is omitted, while logging behavior remains consistent with the selected fix.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.