Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


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:

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.