Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeError on Python 2.7 and git-lfs issue #361

Merged
merged 5 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zest/releaser/baserelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
class Basereleaser(object):

def __init__(self, vcs=None):
os.environ["ZESTRELEASER"] = "We are called from within zest.releaser"
os.environ[str("ZESTRELEASER")] = str("We are called from within zest.releaser")
# ^^^ Env variable so called tools can detect us. Don't depend on the
# actual text, just on the variable's name.
if vcs is None:
Expand Down
10 changes: 3 additions & 7 deletions zest/releaser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,12 +741,10 @@ def format_command(command):


def _subprocess_open(p, command, input_value, show_stderr):
i, o, e = (p.stdin, p.stdout, p.stderr)
if input_value:
i.write(input_value.encode(INPUT_ENCODING))
i.close()
stdout_output = o.read()
stderr_output = e.read()
(stdout_output, stderr_output) = p.communicate(input_value.encode(INPUT_ENCODING))
else:
(stdout_output, stderr_output) = p.communicate()
# We assume that the output from commands we're running is text.
if not isinstance(stdout_output, six.text_type):
stdout_output = stdout_output.decode(OUTPUT_ENCODING)
Expand All @@ -766,8 +764,6 @@ def _subprocess_open(p, command, input_value, show_stderr):
if stderr_output:
logger.debug("Stderr of running command '%s':\n%s",
format_command(command), stderr_output)
o.close()
e.close()
return result


Expand Down