You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restarted Spyder, problem persists. Updated conda, Spyder is up to date. Restarted Spyder again, problem persists.
Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
Done, reports that Spyder already up to date
Tried basic troubleshooting (if a bug/error)
Restarted Spyder
Reset preferences with spyder --reset
Tried the other applicable steps from the Troubleshooting Guide
Completed the Problem Description, Steps to Reproduce and Version sections below
Problem Description
I am writing a .txt file from a python script in Spyder. I would like the end of line (EOL) character to be a line feed (LF), not a carriage return/line feed (CRLF). I have set the EOL character to LF in Spyder, and there are no "\r"s in my script. When I open the file in Notepad++ to check, it shows CRLF, not LF. Spyder displays the EOL option correctly in the bottom right of the viewer.
What steps reproduce the problem?
Set Spyder Preferences -> Editor -> "On save: convert EOL characters" set to "LF (Unix)"
2. Set Source -> Convert end of line characters to "Line Feed (Unix)"
3. Write sample code to a text file
4. Open text file in Notepad++, setting View -> Show symbols -> Show all characters
Sample code:
out_file = open('linefeed_fix_test1.txt', 'w')
test_list = ["line1|value1|value2", "line2|value1|value2", "line3|value1|value2", "line4|value1|value2", "line5|value1|value2"]
for i in test_list:
out_file.write("{}\n".format(i))
out_file.close()
What is the expected output? What do you see instead?
Hey @yum-yum-in-my-tum-tum, thanks for reporting. You're right: we're not setting EOL chars correctly when saving. We'll try to fix that in our next version.
ccordoba12
changed the title
Wrong EOL characters written to file
Wrong EOL characters written to file when saving
Dec 17, 2021
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)spyder --reset
Problem Description
I am writing a .txt file from a python script in Spyder. I would like the end of line (EOL) character to be a line feed (LF), not a carriage return/line feed (CRLF). I have set the EOL character to LF in Spyder, and there are no "\r"s in my script. When I open the file in Notepad++ to check, it shows CRLF, not LF. Spyder displays the EOL option correctly in the bottom right of the viewer.
![](https://user-images.githubusercontent.com/96306206/146585852-8d19d6a6-6fb5-46a9-9558-7bbedd661a7e.png)
What steps reproduce the problem?
![](https://user-images.githubusercontent.com/96306206/146585740-4f54ed5d-d48e-4d1a-a08d-bc5c21c63cef.png)
2. Set Source -> Convert end of line characters to "Line Feed (Unix)"![](https://user-images.githubusercontent.com/96306206/146585803-7a595cd6-b766-4edd-a8e6-64de9ee983f1.png)
3. Write sample code to a text file 4. Open text file in Notepad++, setting View -> Show symbols -> Show all charactersSample code:
What is the expected output? What do you see instead?
Versions
Dependencies
The text was updated successfully, but these errors were encountered: