Skip to content

Commit

Permalink
some new errors from buildifier
Browse files Browse the repository at this point in the history
  • Loading branch information
loosebazooka committed Jan 17, 2022
1 parent 85d7c97 commit 54f7e88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package_manager/dpkg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ def download_dpkg(package_files, packages, workspace_name, versionsfile):
expected_checksum = pkg[SHA256_KEY]
if actual_checksum != expected_checksum:
raise Exception("Wrong checksum for package %s %s (%s). Expected: %s, Actual: %s" %(pkg_name, os.getcwd() + "/" + out_file, pkg[FILENAME_KEY], expected_checksum, actual_checksum))
with open(PACKAGE_MAP_FILE_NAME, 'w') as f:
with open(PACKAGE_MAP_FILE_NAME, 'w', encoding="utf-8") as f:
f.write("packages = " + json.dumps(package_to_rule_map))
f.write("\nversions = " + json.dumps(package_to_version_map))
if versionsfile:
with open(versionsfile, 'w') as f:
with open(versionsfile, 'w', encoding="utf-8") as f:
f.write(json.dumps(package_to_version_map, sort_keys=True, indent=4, separators=(',', ': ')))
f.write('\n')

Expand Down Expand Up @@ -194,7 +194,7 @@ def download_package_list(mirror_url, distro, arch, snapshot, sha256, packages_u
with lzma.open("Packages.xz", 'rb') as f:
data = f.read()
metadata = parse_package_metadata(data, mirror_url, snapshot, package_prefix)
with open(PACKAGES_FILE_NAME, 'w') as f:
with open(PACKAGES_FILE_NAME, 'w', encoding="utf-8") as f:
json.dump(metadata, f)

if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion package_manager/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def generate_os_release(distro, os_release_file):

def build_os_release_tar(distro, os_release_file, os_release_path, tar_file_name):
os.makedirs(os_release_path)
with open(os_release_file, 'w') as os_release:
with open(os_release_file, 'w', encoding="utf-8") as os_release:
generate_os_release(distro, os_release)
with TarFile(output=tar_file_name, directory=None, compression='', root_directory='./', default_mtime=0) as tar:
tar.add_file(os_release_path, os_release_path, mode=0o644)

0 comments on commit 54f7e88

Please sign in to comment.