Azure-Samples / Azure-Samples/ms-identity-python-daemon

Close key file after reading in Python example

オープン
#23 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
PowerShell
スター
62
フォーク
27
PR マージ指標
30日以内にマージされた PR はありません

説明

Don't open a file in Python without closing it. This code is bad mojo:
```
app = msal.ConfidentialClientApplication(
config["client_id"], authority=config["authority"],
client_credential={"thumbprint": config["thumbprint"], "private_key": open(config['private_key_file']).read()},
)
```
Prefer:
```
with open(config['private_key_file']) as f:
key = f.read()
app = msal.ConfidentialClientApplication(
config["client_id"], authority=config["authority"],
client_credential={"thumbprint": config["thumbprint"], "private_key": key },
)
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

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

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