Xpra: Ticket #2485: cmd-line xpra doesn't nicely handle stdout pipe-closed.

Using macos client, xpra v3.0.2-r24371 python2.7 64bit on macos 10.13.6 (High Sierra) and server version on centos-6, xpra v1.0.14-r24088 (xpra.x86_64 1.0.14-1.r24088.el6_6).

On server or client, at command line, commands likes 'xpra info ...', 'xpra showconfig' throw repeating IOErrors if stdout closed early (suspect as many errors as there are remaining lines of output).

Server example (usually I pipe into less, but quit the less early, this simulates that):

$ (xpra info :3 | head) |& head -50
batch.delay.50p=35
batch.delay.80p=46
batch.delay.90p=53
batch.delay.avg=29
batch.delay.cur=2
batch.delay.max=62
batch.delay.min=2
batch.locked=False
batch.max-delay=500
batch.min-delay=5
Traceback (most recent call last):
  File "/usr/lib64/python2.6/logging/__init__.py", line 808, in emit
    self.flush()
  File "/usr/lib64/python2.6/logging/__init__.py", line 770, in flush
    self.stream.flush()
IOError: [Errno 32] Broken pipe
... [repeated IOError's deleted]

Client example:

% ( xpra showconfig | head -2 ) | & head -30
add-printer-options            = '-E', '-o printer-is-shared=false', '-u allow:$USER'
attach                         =
Traceback (most recent call last):
  File "logging/__init__.pyc", line 892, in emit
  File "logging/__init__.pyc", line 852, in flush
IOError: [Errno 32] Broken pipe
... [repeated IOError's deleted]

This is a minor annoyance.



Mon, 18 Nov 2019 13:08:18 GMT - Antoine Martin: status changed; resolution set

This is not really an xpra issue, more of a python "feature". Some links:

Workaround applied in r24450. This may be backported to the 3.1 branch when it opens, this will not be applied to v1.0


Mon, 02 Dec 2019 06:08:57 GMT - sto6:

using Xpra-Python3-x86_64-3.0.3-r24467.pkg:

this is clean, thanks:

% xpra showconfig | head -2
add-printer-options            = '-E', '-o printer-is-shared=false', '-u allow:$USER'
attach                         =
%

but original example still not:

% ( xpra showconfig | head -2 ) | & head -30
add-printer-options            = '-E', '-o printer-is-shared=false', '-u allow:$USER'
attach                         =
--- Logging error ---
Traceback (most recent call last):
  File "logging/__init__.pyc", line 1029, in emit
  File "logging/__init__.pyc", line 1009, in flush
BrokenPipeError: [Errno 32] Broken pipe
Call stack:
  File "<string>", line 1, in <module>
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 117, in main
    return run_mode(script_file, err, options, args, mode, defaults)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 545, in run_mode
    return run_showconfig(options, args)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 2682, in run_showconfig
    i("%-20s           = %s", opt, vstr(cv))
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/log.py", line 405, in info
    self.log(logging.INFO, msg, *args, **kwargs)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/log.py", line 396, in log
    global_logging_handler(self.logger.log, level, msg, *args, **kwargs)
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/log.py", line 135, in standard_logging
    log(level, msg, *args, **kwargs)
  File "logging/__init__.pyc", line 1444, in log
  File "logging/__init__.pyc", line 1514, in _log
  File "logging/__init__.pyc", line 1524, in handle
  File "logging/__init__.pyc", line 1586, in callHandlers
  File "logging/__init__.pyc", line 894, in handle
  File "logging/__init__.pyc", line 1033, in emit
Message: '%-20s           = %s'
Arguments: ('bandwidth-detection', 'True')
--- Logging error ---
%

Mon, 02 Dec 2019 15:54:33 GMT - Antoine Martin:

r24574 fixes your second example: ( xpra showconfig | head -2 ) |& head -30 At least on Linux, MacOS 10.11.x is just complaining about the syntax..

Please try the latest beta builds here: https://xpra.org/beta/MacOS.


Thu, 03 Sep 2020 07:27:01 GMT - Antoine Martin:

Now also available in the 3.1.x branch: r27359.


Sat, 23 Jan 2021 05:52:35 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2485