You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/05 07:11:22 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #20651: Fix mypy in providers/grpc and providers/imap

uranusjr commented on a change in pull request #20651:
URL: https://github.com/apache/airflow/pull/20651#discussion_r778589556



##########
File path: airflow/providers/imap/hooks/imap.py
##########
@@ -71,7 +71,7 @@ def get_conn(self) -> 'ImapHook':
         """
         if not self.mail_client:
             conn = self.get_connection(self.imap_conn_id)
-            self.mail_client = imaplib.IMAP4_SSL(conn.host, conn.port or imaplib.IMAP4_SSL_PORT)
+            self.mail_client = imaplib.IMAP4_SSL(conn.host, conn.port or imaplib.IMAP4_SSL.port)

Review comment:
       I don’t think `IMAP4_SSL.port` is going to work. Whether `IMAP4_SSL_PORT` is public or not is slightly ambiguous; it is not by module definition, [but the variable actually appears in documentation](https://docs.python.org/3/library/imaplib.html#imaplib.IMAP4_SSL). Either case, the IMAP-over-SSL port is standardised (993), so maybe we should just not rely on `imaplib.IMAP4_SSL_PORT` and just define our own variable.




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org