Control: tags -1 + pending Am 19.08.2021 um 17:20 teilte Casey Deccio mit:
Hi, I've added the patch in question to the Debian git repository; tag pending. Hilmar
Running parallel-ssh with the -o option results in RuntimeWarnings
resulting from incorrect use of the buffering option (buffering=1).
casey@host:~$ parallel-ssh -o outdir -h hosts date
/usr/lib/python3/dist-packages/psshlib/manager.py:304: RuntimeWarning: line
buffering (buffering=1) isn't supported in binary mode, the default buffer size
will be used
self.files[filename] = open(filename, 'wb', buffering=1)
/usr/lib/python3/dist-packages/psshlib/manager.py:304: RuntimeWarning: line
buffering (buffering=1) isn't supported in binary mode, the default buffer size
will be used
self.files[filename] = open(filename, 'wb', buffering=1)
[1] 08:55:00 [SUCCESS] host1
[2] 08:55:00 [SUCCESS] host1
According to the python documentation for open():
buffering is an optional integer used to set the buffering policy.
Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
line buffering (only usable in text mode), and an integer > 1 to indicate
the size of a fixed-size chunk buffer. When no buffering argument is
given, the default buffering policy works as follows:
An "upstream" version of has the following fix:
https://github.com/lilydjwg/pssh/commit/5e544a7444aa7a337f64c91d34cf669bef46c1d7
which is equivalent to this in the stable debian package of pssh:
--- /usr/lib/python3/dist-packages/psshlib/manager.py.old 2021-02-22
16:02:07.000000000 -0700
+++ /usr/lib/python3/dist-packages/psshlib/manager.py.new 2021-08-19
09:17:14.226959140 -0600
@@ -301,7 +301,7 @@
return
if data == self.OPEN:
- self.files[filename] = open(filename, 'wb', buffering=1)
+ self.files[filename] = open(filename, 'wb', buffering=0)
psshutil.set_cloexec(self.files[filename])
else:
dest = self.files[filename]
@@ -309,6 +309,7 @@
dest.close()
else:
dest.write(data)
+ dest.flush()
def open_files(self, host):
"""Called from another thread to create files for stdout and stderr.
That works just fine on my system.
-- sigfault
OpenPGP_signature
Description: OpenPGP digital signature

