mik-laj commented on a change in pull request #12094:
URL: https://github.com/apache/airflow/pull/12094#discussion_r517581569
##########
File path: airflow/providers/grpc/hooks/grpc.py
##########
@@ -72,7 +72,7 @@ def get_conn(self) -> grpc.Channel:
channel = grpc.insecure_channel(base_url)
elif auth_type in {"SSL", "TLS"}:
credential_file_name = self._get_field("credential_pem_file")
- creds =
grpc.ssl_channel_credentials(open(credential_file_name).read())
+ creds = grpc.ssl_channel_credentials(open(credential_file_name,
"rb").read())
Review comment:
```suggestion
with open(credential_file_name, "rb") as credential_file:
creds = grpc.ssl_channel_credentials(credential_file.read())
```
Files should be closed when you do not plan to use them anymore. Otherwise,
these files will be open until the process exits.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]