diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2024-04-29 11:18:23 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-04-29 11:18:23 +0200 |
commit | 5d7cdc707996d44ce7d96dab173554117a1aec71 (patch) | |
tree | b27656074556eb099c254bcef332187c1a403a06 | |
parent | 5c184b6772b4c9be2a12c6522da66a765f650553 (diff) | |
download | git-deps-5d7cdc707996d44ce7d96dab173554117a1aec71.tar.gz |
Set encoding to 'utf-8' explicitly, don't use deprecated universal_newlines parameter.py2k_encoding
-rw-r--r-- | git_deps/blame.py | 2 | ||||
-rw-r--r-- | git_deps/detector.py | 2 | ||||
-rw-r--r-- | git_deps/gitutils.py | 6 | ||||
-rw-r--r-- | git_deps/listener/cli.py | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/git_deps/blame.py b/git_deps/blame.py index 41d79fe..4e49f5d 100644 --- a/git_deps/blame.py +++ b/git_deps/blame.py @@ -37,7 +37,7 @@ def blame_via_subprocess(path, commit, start_line, num_lines): '-L', "%d,+%d" % (start_line, num_lines), commit, '--', path ] - output = subprocess.check_output(cmd, universal_newlines=True) + output = subprocess.check_output(cmd, encoding="utf-8") current_hunk = None for line in output.split('\n'): diff --git a/git_deps/detector.py b/git_deps/detector.py index 82996a6..46922bc 100644 --- a/git_deps/detector.py +++ b/git_deps/detector.py @@ -329,7 +329,7 @@ class DependencyDetector(object): cmd = ['git', 'merge-base', sha1, branch_sha1] # self.logger.debug(" ".join(cmd)) - out = subprocess.check_output(cmd, universal_newlines=True).strip() + out = subprocess.check_output(cmd, encoding='utf-8').strip() self.logger.debug(" merge-base returned: %s" % out[:8]) result = out == sha1 self.logger.debug(" %s" % result) diff --git a/git_deps/gitutils.py b/git_deps/gitutils.py index 47355d2..8e0718c 100644 --- a/git_deps/gitutils.py +++ b/git_deps/gitutils.py @@ -15,7 +15,7 @@ class GitUtils(object): # we will be able to do this via pygit2. cmd = ['git', 'rev-parse', '--short', sha1] # cls.logger.debug(" ".join(cmd)) - out = subprocess.check_output(cmd, universal_newlines=True).strip() + out = subprocess.check_output(cmd, encoding='utf-8').strip() # cls.logger.debug(out) return out @@ -40,7 +40,7 @@ class GitUtils(object): out = None try: out = subprocess.check_output( - cmd, stderr=subprocess.STDOUT, universal_newlines=True) + cmd, stderr=subprocess.STDOUT, encoding='utf-8') except subprocess.CalledProcessError as e: if e.output.find('No tags can describe') != -1: return '' @@ -82,7 +82,7 @@ class GitUtils(object): @classmethod def rev_list(cls, rev_range): cmd = ['git', 'rev-list', rev_range] - return subprocess.check_output(cmd, universal_newlines=True) \ + return subprocess.check_output(cmd, encoding='utf-8') \ .strip().split('\n') @classmethod diff --git a/git_deps/listener/cli.py b/git_deps/listener/cli.py index b5f8bb9..348c338 100644 --- a/git_deps/listener/cli.py +++ b/git_deps/listener/cli.py @@ -49,7 +49,7 @@ class CLIDependencyListener(DependencyListener): 'log', '-n1', dependency_sha1 ] - print(subprocess.check_output(cmd, universal_newlines=True)) + print(subprocess.check_output(cmd, encoding='utf-8')) # dependency = detector.get_commit(dependency_sha1) # print(dependency.message + "\n") |