xpra icon
Bug tracker and wiki

Opened 3 weeks ago

Closed 3 weeks ago

Last modified 9 days ago

#2485 closed defect (fixed)

cmd-line xpra doesn't nicely handle stdout pipe-closed.

Reported by: sto6 Owned by: Antoine Martin
Priority: minor Milestone: 4.0
Component: client Version: 3.0.x
Keywords: Cc:

Description

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.

Change History (3)

comment:1 Changed 3 weeks ago by Antoine Martin

Resolution: fixed
Status: newclosed

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

comment:2 Changed 9 days ago by 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 ---
%

comment:3 Changed 9 days ago by 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.

Note: See TracTickets for help on using tickets.