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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user