Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: Unknown properties return None

オープン
#397 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

@gourabsingha1 がすでに取り組んでいます。

2026年6月27日 から。

  • #492 @gourabsingha1 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
api, payments

調査の方向性

Issueで特定された根本原因の箇所であるAdyen/services/base.pyの13-16行目から開始します。AdyenBaseのサブクラスで属性が存在しない例を再現し、不明なキーがどのように処理されるかを調べます。ネストされたAPIオブジェクトも含め、存在しない属性がNoneを返すのではなくAttributeErrorを発生させれば完了です。

索引モデルが issue の本文から書いたものです。

説明

do not stale
Description

Accessing a non-existent property on an API returns None instead of raising an AttributeError

Steps to reproduce

Attempt to access any non-existent attribute on any subclass of AdyenBase

>>> from Adyen import Adyen
>>> api = Adyen(xapikey='token', platform='test')
>>> print(api.foobar)
None
>>> print(api.payment.payments_api.foobar)
None
>>> api.payment.payments_api.fizz()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not callable
Actual behavior

Attempting to access non-existent attribute returns None. Attempting to call a non-existent method throws a "NoneType object is not callable" error.

Expected behavior

Should return an AttributeError.

Code snippet or screenshots (if applicable)

Root cause is here:

https://github.com/Adyen/adyen-python-api-library/blob/fa8079ff69022117f4375a806ee51e82babce56f/Adyen/services/base.py#L13-L16

If key doesn't exist in self.client, the method exits with no return statement, which is the same as returning None. This means any attribute that's requested defaults to None. It should instead raise AttributeError

Adyen Python API Library version

14.0.0

Python Language version

Python 3.10

Operating System

macOS

Additional context

No response

主要言語
Python
スター
68
フォーク
51
平均マージ
2時間 3分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Adyen/adyen-python-api-library のほかの issue

Adyen/adyen-python-api-library の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。