Skip to content

[v3-1-test] Fix exception when logging stdout with a custom %-fmt string. (#58959)#58963

Merged
ashb merged 1 commit intov3-1-testfrom
backport-586fe93-v3-1-test
Dec 2, 2025
Merged

[v3-1-test] Fix exception when logging stdout with a custom %-fmt string. (#58959)#58963
ashb merged 1 commit intov3-1-testfrom
backport-586fe93-v3-1-test

Conversation

@github-actions
Copy link
Copy Markdown

@github-actions github-actions bot commented Dec 2, 2025

For instance, if you set this config

[logging]
log_format={%%(filename)s:%%(lineno)d} --- %%(message)s

this would blow up with an error like this on printing anything from a
trigger, killing the triggerer process:

2025-11-03 14:13:27   File "/usr/local/lib/python3.12/site-packages/airflow/_shared/logging/percent_formatter.py", line 149, in __call__
2025-11-03 14:13:27     sio.write(self._fmt % params)
2025-11-03 14:13:27               ~~~~~~~~~~^~~~~~~~
2025-11-03 14:13:27 TypeError: %d format: a real number is required, not NoneType

(cherry picked from commit 586fe93)

Co-authored-by: Ash Berlin-Taylor ash@apache.org

…ing. (#58959)

For instance, if you set this config

```ini
[logging]
log_format={%%(filename)s:%%(lineno)d} --- %%(message)s
```

this would blow up with an error like this on printing anything from a
trigger, killing the triggerer process:

```
2025-11-03 14:13:27   File "/usr/local/lib/python3.12/site-packages/airflow/_shared/logging/percent_formatter.py", line 149, in __call__
2025-11-03 14:13:27     sio.write(self._fmt % params)
2025-11-03 14:13:27               ~~~~~~~~~~^~~~~~~~
2025-11-03 14:13:27 TypeError: %d format: a real number is required, not NoneType
```
(cherry picked from commit 586fe93)

Co-authored-by: Ash Berlin-Taylor <ash@apache.org>
@ashb ashb merged commit 48f04ab into v3-1-test Dec 2, 2025
48 checks passed
@ashb ashb deleted the backport-586fe93-v3-1-test branch December 2, 2025 18:06
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Dec 3, 2025
@ephraimbuddy ephraimbuddy added this to the Airflow 3.1.4 milestone Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:logging type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants