how can I write a .py file from python such that its type should not be like ‘ASCII file with Windows CRLF’
because when i run file.write(data) inside windows it write the file but when I try to
eval(open(file.py).read()) it fails and gives syntax error because of windows CRLF on each line……
see the error log – traceback
ERROR:web-services:[25]: info = eval(tools.file_open(terp_file).read(-1))
ERROR:web-services:[26]: File "<string>", line 1
ERROR:web-services:[27]: {
ERROR:web-services:[28]:
You can:
open(file, 'wb')or…data.replace('\r','')I would steer clear of
execand useexecfileas mentioned by SilentGhost.