| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cf8dc25 commit 5181437
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,3 +14,4 @@ nbproject | |||
| 14 | 14 | .DS_Store | |
| 15 | 15 | /*egg-info | |
| 16 | 16 | /.tox | |
| 17 | + .idea/ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -76,7 +76,7 @@ def abspath(self): | |||
| 76 | 76 | @classmethod | |
| 77 | 77 | def _get_packed_refs_path(cls, repo): | |
| 78 | 78 | try: | |
| 79 | - commondir = open(osp.join(repo.git_dir, 'commondir'), 'rt').readlines()[0].strip() | ||
| 79 | + commondir = open(osp.join(repo.git_dir, 'commondir'), 'rt', encoding="utf-8").readlines()[0].strip() | ||
| 80 | 80 | except (OSError, IOError): | |
| 81 | 81 | commondir = '.' | |
| 82 | 82 | repodir = osp.join(repo.git_dir, commondir) | |
@@ -87,7 +87,7 @@ def _iter_packed_refs(cls, repo): | |||
| 87 | 87 | """Returns an iterator yielding pairs of sha1/path pairs (as bytes) for the corresponding refs. | |
| 88 | 88 | :note: The packed refs file will be kept open as long as we iterate""" | |
| 89 | 89 | try: | |
| 90 | - with open(cls._get_packed_refs_path(repo), 'rt') as fp: | ||
| 90 | + with open(cls._get_packed_refs_path(repo), 'rt', encoding="utf-8") as fp: | ||
| 91 | 91 | for line in fp: | |
| 92 | 92 | line = line.strip() | |
| 93 | 93 | if not line: | |
@@ -133,7 +133,7 @@ def _get_ref_info_helper(cls, repo, repodir, ref_path): | |||
| 133 | 133 | point to, or None""" | |
| 134 | 134 | tokens = None | |
| 135 | 135 | try: | |
| 136 | - with open(osp.join(repodir, ref_path), 'rt') as fp: | ||
| 136 | + with open(osp.join(repodir, ref_path), 'rt', encoding="utf-8") as fp: | ||
| 137 | 137 | value = fp.read().rstrip() | |
| 138 | 138 | # Don't only split on spaces, but on whitespace, which allows to parse lines like | |
| 139 | 139 | # 60b64ef992065e2600bfef6187a97f92398a9144 branch 'master' of git-server:/path/to/repo | |
@@ -173,7 +173,7 @@ def _get_ref_info(cls, repo, ref_path): | |||
| 173 | 173 | return cls._get_ref_info_helper(repo, repo.git_dir, ref_path) | |
| 174 | 174 | except ValueError: | |
| 175 | 175 | try: | |
| 176 | - commondir = open(osp.join(repo.git_dir, 'commondir'), 'rt').readlines()[0].strip() | ||
| 176 | + commondir = open(osp.join(repo.git_dir, 'commondir'), 'rt', encoding="utf-8").readlines()[0].strip() | ||
| 177 | 177 | except (OSError, IOError): | |
| 178 | 178 | commondir = '.' | |
| 179 | 179 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,7 +58,7 @@ def find_worktree_git_dir(dotgit): | |||
| 58 | 58 | return None | |
| 59 | 59 | ||
| 60 | 60 | try: | |
| 61 | - lines = open(dotgit, 'r').readlines() | ||
| 61 | + lines = open(dotgit, 'r', encoding="utf-8").readlines() | ||
| 62 | 62 | for key, value in [line.strip().split(': ') for line in lines]: | |
| 63 | 63 | if key == 'gitdir': | |
| 64 | 64 | return value | |
@@ -73,7 +73,7 @@ def find_submodule_git_dir(d): | |||
| 73 | 73 | return d | |
| 74 | 74 | ||
| 75 | 75 | try: | |
| 76 | - with open(d) as fp: | ||
| 76 | + with open(d, encoding="utf-8") as fp: | ||
| 77 | 77 | content = fp.read().rstrip() | |
| 78 | 78 | except (IOError, OSError): | |
| 79 | 79 | # it's probably not a file | |
| Back | FazBrowse Home | New Git URL |
0 commit comments