Skip to content

Commit

Permalink
Explicitly specify encoding for stdout of subcommands.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillof committed Jul 19, 2023
1 parent 452f44c commit cc10033
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)

# Also update version in nihtest/__main__.py and pyproject.toml
project(nihtest
VERSION 1.1.1
VERSION 1.2.0
DESCRIPTION "NiH testing framework"
HOMEPAGE_URL "https://github.com/nih-at/nihtest"
LANGUAGES C)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.2.0 [2023-07-19]

- Explicitly specify encoding for stdout of subcommands.

# 1.1.1 [2023-06-27]

- Fix Windows compatibility.
Expand Down
4 changes: 2 additions & 2 deletions nihtest/Command.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def run(self):
raise RuntimeError(f"can't find program {self.program}")
if self.stdin_file is not None:
with open(self.stdin_file, "rb") as stdin:
result = subprocess.run([program] + self.arguments, capture_output=True, check=False, text=True, stdin=stdin, env=self.environment)
result = subprocess.run([program] + self.arguments, capture_output=True, check=False, text=True, encoding="utf-8", stdin=stdin, env=self.environment)
else:
result = subprocess.run([program] + self.arguments, capture_output=True, check=False, text=True, input=self.stdin, env=self.environment)
result = subprocess.run([program] + self.arguments, capture_output=True, check=False, text=True, encoding="utf-8", input=self.stdin, env=self.environment)
self.exit_code = result.returncode
self.stdout = result.stdout.splitlines()
self.stderr = result.stderr.splitlines()
2 changes: 1 addition & 1 deletion nihtest/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from nihtest import Test
from nihtest import Configuration

VERSION = "1.1.1"
VERSION = "1.2.0"


def main():
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "nihtest"
version = "1.1.1"
version = "1.2.0"
authors = [
{ name="Dieter Baron", email="dillo@nih.at" },
{ name="Thomas Klausner", email="wiz@gatalith.at"}
Expand All @@ -27,7 +27,7 @@ classifiers = [
nihtest = "nihtest.__main__:main"

[tool.bumpver]
current_version = "1.1.1"
current_version = "1.2.0"
version_pattern = "MAJOR.MINOR.PATCH"

[tool.bumpver.file_patterns]
Expand Down

0 comments on commit cc10033

Please sign in to comment.