I use a script to update the version of each AssemblyVersion.cs file of a .NET project. It always worked perfectly, but since a format my PC, it adds unicode character at the start of each .cs file edited. Like this:
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;
I use this code to open a file:
with open(fname, "r") as f:
out_fname = fname + ".tmp"
out = codecs.open(out_fname, "w", encoding='utf-8')
textInFile=""
for line in f:
textInFile += (re.sub(pat, s_after,line))
out.write(u'\uFEFF')
out.write(textInFile)
out.close()
os.remove(fname)
os.rename(out_fname, fname)
I've also tried, as wrote here, to use io instead of codecs, but nothing is changed.
On other teammates' PCs it works with the same configuration (Win10 and IronPython 2.7).
What can I try to solve this issue? Where can I looking for the problem?
Thanks