Skip to content

Commit 65a6b4e

Browse files
authored
Merge pull request #97 from ploxiln/update_ci_py314
ci: add python-3.14 and debian 13 "trixie" update flake8/pyflakes for newer python handle TIOCGWINSZ struct correctly
2 parents ef450b8 + a72025b commit 65a6b4e

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.github/workflows/linux.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ jobs:
2828
- {imgtag: "3.10-bookworm", paramiko: "paramiko-ng==2.9.0"}
2929
- {imgtag: "3.11-bookworm", paramiko: "paramiko-ng==2.9.0"}
3030
- {imgtag: "3.12-bookworm", paramiko: "paramiko-ng==2.9.0"}
31-
- {imgtag: "3.13-bookworm", paramiko: "paramiko-ng==2.9.0"}
31+
- {imgtag: "3.13-trixie", paramiko: "paramiko-ng==2.9.0"}
32+
- {imgtag: "3.14-trixie", paramiko: "paramiko-ng==2.9.0"}
3233
- {imgtag: "3.12-bookworm", paramiko: "paramiko==3.3.2"}
3334
- {imgtag: "3.12-bookworm", paramiko: "paramiko==3.5.1"}
34-
- {imgtag: "3.12-bookworm", paramiko: "paramiko==4.0.0"}
35+
- {imgtag: "3.13-trixie", paramiko: "paramiko==4.0.0"}
3536

3637
container: "python:${{matrix.imgtag}}"
3738
steps:

dev-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ https://github.com/ploxiln/fudge/archive/refs/heads/py3.tar.gz#egg=fudge
66
# used in some tests
77
jinja2 <4.0
88
# flake8
9-
flake8 <6
9+
flake8==5.0.4; python_version<"3.9"
10+
flake8==7.3.0; python_version>="3.9"

fabric/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,16 +285,17 @@ def _pty_size():
285285
import fcntl
286286
import termios
287287
# We want two short unsigned integers (rows, cols)
288-
fmt = 'HH'
288+
# Note: TIOCGWINSZ struct contains 4 unsigned shorts, 2 unused
289+
fmt = 'HHHH'
289290
# Create an empty (zeroed) buffer for ioctl to map onto. Yay for C!
290-
buffer = struct.pack(fmt, 0, 0)
291+
buffer = struct.pack(fmt, 0, 0, 0, 0)
291292
# Call TIOCGWINSZ to get window size of stdout, returns our filled
292293
# buffer
293294
try:
294295
result = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ,
295296
buffer)
296297
# Unpack buffer back into Python data types
297-
rows, cols = struct.unpack(fmt, result)
298+
rows, cols, _, _ = struct.unpack(fmt, result)
298299
# Fall back to defaults if TIOCGWINSZ returns unreasonable values
299300
if rows == 0:
300301
rows = default_rows

0 commit comments

Comments
 (0)