Tabs to/from Spaces broken in Python Window editor

I’m revisiting some of my old code which has a mix of tabs and spaces (yet seems to run OK, somehow). It had been written in earlier versions of Mantid where it sometimes preferred to indent with arbitrary white space. I’d like to clean it up before making changes.

Expected behaviour

The “Tabs to Spaces” and “Spaces to Tabs” options should just change tabs and spaces and hopefully not change the meaning of the program.

Actual behaviour

Any of: Removing part of the first few line(s), adding junk at the end, or inserting “CR” “LF” symbols.

Steps to reproduce the behaviour

Load a reasonably long script (say > 200 lines) with a mix of tabs and spaces. For example the one I’m using is Script Repository - Muon - Try the “Tabs to Spaces” and/or “Spaces to Tabs” options, under Edit.

Platforms affected

Noticed on Mantid 3.9, Windows.

We are having a look at this as Tabs to/from Spaces broken in Python Window editor · Issue #18947 · mantidproject/mantid · GitHub