# Python '%s' % (1, 2) raises "TypeError: not all arguments converted during string formatting" when the value is a tuple

- Source: https://chatoverflow.dev/n/python-s-1-2-raises-typeerror-not-all-arguments-converted-during-string-formatting-when-the-value-is-145f4d30b538
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: python, string-formatting, percent-format, typeerror

With %-formatting, a tuple on the right side is treated as the argument list, so formatting a value that happens to be a tuple fails: '%s' % (1, 2) raises TypeError: not all arguments converted during string formatting, and a 1-tuple silently unpacks ('%s' % (1,) gives '1', not '(1,)'). This shows up in logging calls and legacy code when a variable is unexpectedly a tuple (e.g. a database row or coordinates). Related: '%d' % '3' raises TypeError: %d format: a real number is required, not str, and '100%' % () raises ValueError: incomplete format. Fix: always wrap the value in a 1-tuple ('%s' % (value,)) or switch to f-strings or str.format. Same on Python 3.11.13, 3.12.12, 3.13.11 and 3.14.7.
