Skip to content

Commit eb14202

Browse files
authored
py(deps) libtmux 0.40.1 -> 0.42.0, modernize run_before_script() (#958)
## py(deps) libtmux 0.40.1 -> 0.42.0 - tree: https://github.com/tmux-python/libtmux/tree/v0.42.0 - releases: https://github.com/tmux-python/libtmux/releases/tag/v0.42.0 - changelog: https://libtmux.git-pull.com/history.html#libtmux-0-42-0-2025-02-02 - PyPI: https://pypi.org/project/libtmux/0.42.0/ ## run_before_script: Remove reliance on `console_to_str()` See also: tmux-python/libtmux#560
2 parents a7db220 + 919324f commit eb14202

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

CHANGES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force
1919

2020
<!-- Maintainers, insert changes / features for the next release here -->
2121

22+
### Development
23+
24+
- libtmux: Bump minimum version from 0.40.1 -> 0.42.0 (#958)
25+
26+
- `run_before_script()`: Remove reliance on `console_to_str()`
27+
2228
## tmuxp 1.51.0 (2025-02-02)
2329

2430
_Maintenance only, no bug fixes or new features_

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ include = [
3939
{ path = "conftest.py", format = "sdist" },
4040
]
4141
dependencies = [
42-
"libtmux~=0.40.1",
42+
"libtmux~=0.42.0",
4343
"colorama>=0.3.9",
4444
"PyYAML>=6.0"
4545
]

src/tmuxp/util.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import sys
1010
import typing as t
1111

12-
from libtmux._compat import console_to_str
13-
1412
from . import exc
1513

1614
if t.TYPE_CHECKING:
@@ -37,16 +35,19 @@ def run_before_script(
3735
stderr=subprocess.PIPE,
3836
stdout=subprocess.PIPE,
3937
cwd=cwd,
38+
text=True,
39+
errors="backslashreplace",
40+
encoding="utf-8",
4041
)
4142
if proc.stdout is not None:
42-
for line in iter(proc.stdout.readline, b""):
43-
sys.stdout.write(console_to_str(line))
43+
for line in iter(proc.stdout.readline, ""):
44+
sys.stdout.write(line)
4445
proc.wait()
4546

4647
if proc.returncode and proc.stderr is not None:
4748
stderr = proc.stderr.read()
4849
proc.stderr.close()
49-
stderr_strlist = console_to_str(stderr).split("\n")
50+
stderr_strlist = stderr.split("\n")
5051
stderr_str = "\n".join(list(filter(None, stderr_strlist))) # filter empty
5152

5253
raise exc.BeforeLoadScriptError(

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)