diff options
Diffstat (limited to 'Mailman/Cgi/edithtml.py')
-rw-r--r-- | Mailman/Cgi/edithtml.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Mailman/Cgi/edithtml.py b/Mailman/Cgi/edithtml.py index 493763b4..756b6c34 100644 --- a/Mailman/Cgi/edithtml.py +++ b/Mailman/Cgi/edithtml.py @@ -158,10 +158,14 @@ def ChangeHTML(mlist, cgi_info, template_name, doc): code = cgi_info['html_code'].value langdir = os.path.join(mlist.fullpath(), mlist.preferred_language) # Make sure the directory exists + omask = os.umask(0) try: - os.mkdir(langdir, 02775) - except OSError, e: - if e.errno <> errno.EEXIST: raise + try: + os.mkdir(langdir, 02775) + except OSError, e: + if e.errno <> errno.EEXIST: raise + finally: + os.umask(omask) fp = open(os.path.join(langdir, template_name), 'w') try: fp.write(code) |