Skip to content
Snippets Groups Projects
Commit 4509f3cc authored by Gary E. Miller's avatar Gary E. Miller :speech_balloon:
Browse files

Revert "OPen all files with "b" flag. For Python 3 compatibility"

This reverts commit 950d1fd9.

Well, that ended quickly and badly...
parent 9206f420
No related branches found
No related tags found
Loading
......@@ -66,7 +66,7 @@ def gnuplot(template, outfile=None):
if outfile is None:
out = None
else:
out = open(outfile, "wb")
out = open(outfile, "w")
# shell=True is a security hazard
proc = subprocess.Popen("gnuplot",
shell=False, bufsize=4096,
......@@ -783,13 +783,13 @@ if __name__ == '__main__':
# if no ntpsec favicon.ico, write one.
ico_filename = os.path.join(outdir, "favicon.ico")
if not os.path.lexists( ico_filename ):
with open( ico_filename, "wb" ) as wp:
with open( ico_filename, "w" ) as wp:
wp.write(binascii.a2b_base64(ntpsec_ico))
# if no ntpsec logo, write one.
logo_filename = os.path.join(outdir, "ntpsec-logo.png")
if not os.path.lexists( logo_filename ):
with open( logo_filename, "wb" ) as wp:
with open( logo_filename, "w" ) as wp:
wp.write(binascii.a2b_base64(ntpsec_logo))
explanations = {
......@@ -882,7 +882,7 @@ at 0s. Typical 90% ranges may be: local serial GPS 200 ms; local LAN peer
title = 'ntpviz'
if os.path.isfile(title_f):
try:
title_file = open( title_f, 'rb')
title_file = open( title_f, 'r')
title = title_file.read()
except IOError:
pass
......@@ -1012,7 +1012,7 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
header = os.path.join(outdir, "header")
if os.path.isfile(header):
try:
header_file = open( header, 'rb')
header_file = open( header, 'r')
header_txt = header_file.read()
index_buffer += '<br>\n' + header_txt + '\n'
except IOError:
......@@ -1066,7 +1066,7 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
footer = os.path.join(outdir, "footer")
if os.path.isfile(footer):
try:
footer_file = open( footer, 'rb')
footer_file = open( footer, 'r')
footer_txt = footer_file.read()
index_buffer += '<br>\n' + footer_txt + '\n'
except IOError:
......@@ -1074,7 +1074,7 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
index_buffer += index_trailer
# and send the file buffer
with open(os.path.join(outdir, "index.html"), "wb") as ifile:
with open(os.path.join(outdir, "index.html"), "w") as ifile:
ifile.write(index_buffer)
ifile.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment