Using web2py on windows 2008 server I have a following problem
I am creating csv document from json and when writting list to file i get the following error. It crashes on csv writerow
<type 'exceptions.UnicodeEncodeError'> 'ascii' codec can't encode character u'\\u010c'
It works ok on my computer. Windows 7 but on server I have an encoding problems
any suggestions? thank you
My code for creating file is the following
dataDict = json.loads(data.replace("'", "\""))
path = path
scriptName = os.path.join(path, id + 'script.txt')
file = open(scriptName, 'wb')
output = csv.writer(file, delimiter='\t')
##Month hours
file.write("begin month_hours \r\n")
file.write("delavec mesec month_hours_min month_hours_max\r\n")
for rec in dataDict["mandatory"]:
output.writerow(rec)
file.write("\r\nend month_hours \r\n")