1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 05:01:29 +00:00

Ensure UTF-8 encoding used throughout zenmap

This commit is contained in:
dmiller
2024-04-26 17:25:40 +00:00
parent 480803e24a
commit c840e236cb
12 changed files with 48 additions and 36 deletions

View File

@@ -73,14 +73,14 @@ NAME_PY = os.path.join("zenmapCore", "Name.py")
def update_date(base_dir):
name_file = os.path.join(base_dir, NAME_PY)
print(">>> Updating %s" % name_file)
nf = open(name_file, "r")
nf = open(name_file, "r", encoding="utf-8")
ncontent = nf.read()
nf.close()
ncontent = re.sub(r'APP_COPYRIGHT *= *"Copyright 2005-....',
'APP_COPYRIGHT = "Copyright 2005-%d' % (datetime.today().year),
ncontent)
# Write the modified file.
nf = open(name_file, "w")
nf = open(name_file, "w", encoding="utf-8")
nf.write(ncontent)
nf.close()
@@ -88,7 +88,7 @@ def update_date(base_dir):
def update_version(base_dir, version):
version = re.sub(r'(?=[^0-9.])', '+', version, 1)
print(">>> Updating %s" % os.path.join(base_dir, VERSION_PY))
vf = open(os.path.join(base_dir, VERSION_PY), "w")
vf = open(os.path.join(base_dir, VERSION_PY), "w", encoding="utf-8")
print("VERSION = \"%s\"" % version, file=vf)
vf.close()