Bug report
Bug description:
#ANSI colour code for red foreground, '\033[31m', and '0'
example_string = "\033[31m0"
print(f"|{ example_string:<3}|")
Produces the following output:
|0|
Which is not padded as would be expected
Removing the colour code however
example_string = "0"
print(f"|{ example_string:<3}|")`
Produces the expected value
|0 |
This leads to misalignment when padding coloured content
CPython versions tested on:
3.13
Operating systems tested on:
No response