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 2021/12/05 09:45:23 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #20039: Fix infinite recursion on redact log

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



##########
File path: airflow/utils/log/secrets_masker.py
##########
@@ -213,11 +213,13 @@ def _redact(self, item: "RedactableItem", name: Optional[str], depth: int) -> "R
             else:
                 return item
         # I think this should never happen, but it does not hurt to leave it just in case
+        # Well. It happened (see https://github.com/apache/airflow/issues/19816#issuecomment-983311373)
+        # but it caused infinite recursion, so we need to cast it to str first.
         except Exception as e:
             log.warning(
-                "Unable to redact %r, please report this via <https://github.com/apache/airflow/issues>. "
+                "Unable to redact %s, please report this via <https://github.com/apache/airflow/issues>. "
                 "Error was: %s: %s",
-                item,
+                str(item),
                 type(e).__name__,
                 str(e),
             )

Review comment:
       Eithe you don’t need to `str()` (it is implied by `%s`), or you should `str()` and then use `%r`.




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