diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-06 00:15:50 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-06 00:15:50 +0500 |
| commit | 4925d9d261794df05efc594a275754eee29d4a63 (patch) | |
| tree | 33bb1f528b9b549652ae4b99d08511aa080ab33d | |
| parent | move URL-related stuff to url.py (diff) | |
| download | cgitize-8.0.4.tar.gz cgitize-8.0.4.zip | |
pylint fixesv8.0.4
| -rw-r--r-- | cgitize/cgit.py | 4 | ||||
| -rw-r--r-- | cgitize/github.py | 3 | ||||
| -rw-r--r-- | cgitize/header.py | 2 | ||||
| -rw-r--r-- | cgitize/utils.py | 2 |
4 files changed, 5 insertions, 6 deletions
diff --git a/cgitize/cgit.py b/cgitize/cgit.py index a81ce13..9e8d46d 100644 --- a/cgitize/cgit.py +++ b/cgitize/cgit.py @@ -30,7 +30,7 @@ class CGitRCWriter: return os.path.join(repo_dir, "cgitrc") def write(self, repo_dir, repo): - with open(self.get_path(repo_dir), "w") as fd: + with open(self.get_path(repo_dir), "w", encoding="utf-8") as fd: self._write_field(fd, "clone-url", self._build_clone_url(repo)) self._write_field(fd, "owner", repo.owner) self._write_field(fd, "desc", repo.desc) @@ -61,7 +61,7 @@ class AgeFile: timestamp = AgeFile.get_age(repo_dir) if timestamp: os.makedirs(AgeFile.get_dir(repo_dir), exist_ok=True) - with open(AgeFile.get_path(repo_dir), mode="w") as fd: + with open(AgeFile.get_path(repo_dir), mode="w", encoding="utf-8") as fd: fd.write(f"{timestamp}") @staticmethod diff --git a/cgitize/github.py b/cgitize/github.py index 6bf3140..218763e 100644 --- a/cgitize/github.py +++ b/cgitize/github.py @@ -41,8 +41,7 @@ class GitHub: # To get private repositories, get_user() must be called # without arguments: return self._impl.get_user().get_repos(affiliation="owner", **kwargs) - else: - return self._impl.get_user(user.name).get_repos(**kwargs) + return self._impl.get_user(user.name).get_repos(**kwargs) except GithubException: logging.error("Couldn't fetch user repositories: %s", user.name) raise diff --git a/cgitize/header.py b/cgitize/header.py index 3bcf353..0947aaf 100644 --- a/cgitize/header.py +++ b/cgitize/header.py @@ -5,7 +5,7 @@ def update(path, success, error=None): - with open(path, "w") as file: + with open(path, "w", encoding="utf-8") as file: contents = "" if not success: contents = ( diff --git a/cgitize/utils.py b/cgitize/utils.py index c86e2d8..fc21d9e 100644 --- a/cgitize/utils.py +++ b/cgitize/utils.py @@ -99,7 +99,7 @@ def protected_file(path): finally: os.chmod(path, old_permissions) else: - with open(path, mode="w"): + with open(path, mode="w", encoding="utf-8"): pass os.chmod(path, new_permissions) try: |
