Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
About two seconds after the window starts, each previously opened empty init.py is saved as 1 byte (0a). Other empty init.py files in the same repo stay 0 bytes.
Steps to Reproduce
Use a Git repo that contains empty init.py files (0 bytes), already committed.
Open a few of them in Cursor once, in any earlier session.
User settings:
“files.insertFinalNewline”: false,
“files.trimFinalNewlines”: true
Close every editor tab.
Restore the files from another terminal:
git restore – path/to/init.py
Quit Cursor and open the same project again.
Expected Behavior
A 0-byte file stays 0 bytes. Should stop a newline from being added.
Screenshots / Screen Recordings
Operating System
MacOS
Version Information
Cursor version: 3.25.6 (Universal)
Additional Information
Still happening on 3.25.6, after the fix staff described for 2.3 in Cursor adds newline to files with existing newlines
No tabs were open. files.insertFinalNewline is false. files.trimFinalNewlines is true. files.hotExit off did not stop it. PyCharm “Ensure every saved file ends with a line break” is unchecked.
After git restore, the files were 0 bytes. The window started at 12:03:29. At 12:03:32, 6 of the empty init.py files were each 1 byte, 0a. Cursor did not ask to save. The other 348 empty init.py files in the same repo stayed 0 bytes. The 6 had been opened in an earlier session.
Same write on earlier restarts at 11:26:49 and 11:38:22.
The added newline makes the file fail pycodestyle W391 (blank line at end of file). PyCharm treats that as an error and blocks the commit. These files are package markers and are stored in Git as 0 bytes, which does not trigger W391.
Does this stop you from using Cursor
No - Cursor works, but with this issue
