From within PythonWin editor, inserting a string containing a certain special character (–, as seen in "Char to paste.txt") into a python string object, and then attempting to save the file, causes the source file to be erased completely, from outside the editor.
Using the 2 attached files, copy the character in "Char to paste.txt" to the clipboard. Open "Bug Demo.py" with PythonWin, and paste the character into the second string in the same location as the hyphen in the first string. Save the file.
At the very minimum, this error should be handled much more gracefully. I nearly lost a significant amount of code when this happened initially, and fortunately I chose NOT to reload the (now empty) file in the editor, so I had the opportunity to copy the code.
PyWin32 build 214
64-bit Windows 7 Ultimate