SUMMARY Code is duplicated when formatting Python source with the last line not being empty STEPS TO REPRODUCE 1. create a file with content `print ()\na = 1` (where \n stands for a newline) NOTE: no trailing newline, the file should contain exactly those two lines and no empty one at the end 2. run format (Ctrl+T,F by default) 3. the file is now `a = 1\nprint ()\na = 1` instead of `print()\na = 1\n` OBSERVED RESULT Not formatted and with a line having been duplicated: `a = 1\nprint ()\na = 1` EXPECTED RESULT formatted and no duplicate: `print()\na = 1\n` SOFTWARE/OS VERSIONS Operating System: Kubuntu 24.04 KDE Plasma Version: 5.27.11 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.13 ADDITIONAL INFORMATION -
This was fixed long ago. Please update to version 24.05 or later