Editing Python script does not save proper indentation

Advertisement

bl1273
Guest

Editing Python script does not save proper indentation

I have been using WinSCP to edit Python scripts on servers for many years. Recently (in the last month) I ran into an issue. With WinSCP, I edit any script using Sublime or Notepad++ as the editor and save it. When displaying the script, it looks like the indentation is correct, but when running the script, I get an indentation error.

When I open the script using nano on the server, I can see that indeed my indentation was not saved properly by WinSCP. I have no workaround for this. I've been forced to update scripts using VI or nano, which is less than optimal.

My PC is running Windows 10 Enterprise
My WinSCP version is 5.21.1
I'm not aware of any updates to my platform that coincide with the start of this issue.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Editing Python script does not save proper indentation

I cannot imagine this being WinSCP issue.

Make sure you do not have text transfer mode set in WinSCP. Even if you have, it should not cause any problems. But with the binary mode, WinSCP does not modify the uploaded file in any way, ever.

Double check your editors configuration. Check contents of the temporary copy of the file saved by your editor.
Some of the hints here may help:
https://winscp.net/eng/docs/faq_line_breaks#debugging

Reply with quote

Advertisement

You can post new topics in this forum