diff --git a/CHANGES b/CHANGES index 6ce59c1d8a..22e3f9cd7a 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,12 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force +### Development + +- libtmux: Bump minimum version from 0.40.1 -> 0.42.0 (#958) + + - `run_before_script()`: Remove reliance on `console_to_str()` + ## tmuxp 1.51.0 (2025-02-02) _Maintenance only, no bug fixes or new features_ diff --git a/pyproject.toml b/pyproject.toml index 088692aade..d4267b3528 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ include = [ { path = "conftest.py", format = "sdist" }, ] dependencies = [ - "libtmux~=0.40.1", + "libtmux~=0.42.0", "colorama>=0.3.9", "PyYAML>=6.0" ] diff --git a/src/tmuxp/util.py b/src/tmuxp/util.py index b81fdb6e7e..893b73d379 100644 --- a/src/tmuxp/util.py +++ b/src/tmuxp/util.py @@ -9,8 +9,6 @@ import sys import typing as t -from libtmux._compat import console_to_str - from . import exc if t.TYPE_CHECKING: @@ -37,16 +35,19 @@ def run_before_script( stderr=subprocess.PIPE, stdout=subprocess.PIPE, cwd=cwd, + text=True, + errors="backslashreplace", + encoding="utf-8", ) if proc.stdout is not None: - for line in iter(proc.stdout.readline, b""): - sys.stdout.write(console_to_str(line)) + for line in iter(proc.stdout.readline, ""): + sys.stdout.write(line) proc.wait() if proc.returncode and proc.stderr is not None: stderr = proc.stderr.read() proc.stderr.close() - stderr_strlist = console_to_str(stderr).split("\n") + stderr_strlist = stderr.split("\n") stderr_str = "\n".join(list(filter(None, stderr_strlist))) # filter empty raise exc.BeforeLoadScriptError( diff --git a/uv.lock b/uv.lock index ffb5fd2cc2..94e8574413 100644 --- a/uv.lock +++ b/uv.lock @@ -375,11 +375,11 @@ wheels = [ [[package]] name = "libtmux" -version = "0.40.1" +version = "0.42.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/20/53/d30bf462b0a005e4541b1c217e15107970063aad99145a259d75b23d35bd/libtmux-0.40.1.tar.gz", hash = "sha256:98ffe2b4922449e89dcd0072e1852bcd5757944fd34159d70ed3e57df398796d", size = 318731 } +sdist = { url = "https://files.pythonhosted.org/packages/ea/79/630e2b1b271e59cc17988f9b5473ea17850555b7734f6df25be16f0bd6a2/libtmux-0.42.0.tar.gz", hash = "sha256:5a13bc98d85fdb7105eea880d8f7017c8c4cca6563485972dd4550c57b66ee6f", size = 318619 } wheels = [ - { url = "https://files.pythonhosted.org/packages/92/89/179a35a1f0964466bdeb8db2b3b071780693490abd10d28e151b51088747/libtmux-0.40.1-py3-none-any.whl", hash = "sha256:aa8bd4a052ed6ce2686f46fa884022d79e900321b17428e87cc5d1b91fcb6081", size = 56185 }, + { url = "https://files.pythonhosted.org/packages/51/6e/6c5e6512927b8ecc2d236dbe6ac9b756717869e80a5994ca3dcbc25f3403/libtmux-0.42.0-py3-none-any.whl", hash = "sha256:bd3ab89d4fae9422d4e1f2701383d147aff61fe630a001ccfa7fdd9a69c7972f", size = 56057 }, ] [[package]] @@ -1241,7 +1241,7 @@ testing = [ [package.metadata] requires-dist = [ { name = "colorama", specifier = ">=0.3.9" }, - { name = "libtmux", specifier = "~=0.40.1" }, + { name = "libtmux", specifier = "~=0.42.0" }, { name = "pyyaml", specifier = ">=6.0" }, ]