cpython icon indicating copy to clipboard operation
cpython copied to clipboard

Incorrect calculation of indentation width in case of mixed tabs and spaces in plistlib

Open serhiy-storchaka opened this issue 2 weeks ago • 1 comments

Bug report

There is the indent parameter in plistlib._PlistWriter, which is b'\t' by default. write_bytes() calculates the width of the indentation, but doe it incorrect if the indentation is a mix of tabs and spaces.

Now, there is no public API to specify indent. it is always b'\t', for which an incorrect code works correctly. But if someone uses private plistlib._PlistWriter, they can encounter that bug.

Linked PRs

  • gh-143347

serhiy-storchaka avatar Jan 02 '26 10:01 serhiy-storchaka