Azure-Samples / Azure-Samples/ms-identity-python-daemon
Close key file after reading in Python example
- Langage dominant
- PowerShell
- Étoiles
- 62
- Forks
- 27
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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 },
)
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.