2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-29 05:11:52 +00:00

Catch permissions error.

This commit is contained in:
Philip Sargent 2021-12-05 17:45:45 +00:00
parent 1aef81dccc
commit bb97b7c862

View File

@ -147,6 +147,8 @@ class SvxForm(forms.Form):
if not os.path.exists(newpath): if not os.path.exists(newpath):
os.makedirs(newpath) os.makedirs(newpath)
fout = open(fname, "wt", encoding='utf8',newline='\n') fout = open(fname, "wt", encoding='utf8',newline='\n')
except PermissionError:
return "CANNOT save this file.\nPERMISSIONS incorrectly set on server for this file. Ask a nerd to fix this."
# javascript seems to insert CRLF on WSL1 whatever you say. So fix that: # javascript seems to insert CRLF on WSL1 whatever you say. So fix that:
res = fout.write(rcode.replace("\r","")) res = fout.write(rcode.replace("\r",""))