Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API情報が参照渡しなので元のAPI情報を書き換えてしまう #149

Closed
1 task done
MtkN1 opened this issue Mar 31, 2022 · 0 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@MtkN1
Copy link
Member

MtkN1 commented Mar 31, 2022

課題

現状pybotters.Clientに渡すAPI情報(apis 引数)は参照のまま使っており、pybotters.Client._encode_apisでシークレットがbytes化される。

https://github.com/MtkN1/pybotters/blob/571fa207470d9aebed4b2966815489bd1e5c95b6/pybotters/client.py#L249-L260

明示的にapisを指定してる(ファイルからの読み込みでない)場合、2度目のpybotters.Client生成時に同じ変数を渡すと既にbytesになっているのでエラーになってしまう。

参照渡しではなく値渡しに修正する。

チェックリスト

  • 修正
@MtkN1 MtkN1 added the bug Something isn't working label Mar 31, 2022
@MtkN1 MtkN1 self-assigned this Mar 31, 2022
MtkN1 added a commit that referenced this issue Mar 31, 2022
MtkN1 added a commit that referenced this issue Mar 31, 2022
MtkN1 added a commit that referenced this issue Mar 31, 2022
✨v0.12.0リリース

## Issues

✅MEXCのAPI認証に対応する #142
✅ソースコードの文字列クォーテーションを正規化する #145
⏩試験的に既存の機能を分離し抽象化を強化する #147
✅API情報が参照渡しなので元のAPI情報を書き換えてしまう #149
✅空の辞書をapisに渡すと意図しない暗黙的な読み込みをする #151

## Pull requests

✅initializeの際のエラー時(主に認証エラー)にエラーメッセージを表示するように #144
@MtkN1 MtkN1 closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant