[Python-apps-team] Bug#907992: xdot: Cannot read from standard input
Ruben Undheim
ruben.undheim at beebeetle.com
Tue Sep 4 22:36:38 BST 2018
Package: xdot
Version: 0.9-2
Severity: important
Dear Maintainer,
xdot cannot read from stdin.
This is unfortunately how I usually use xdot..
I usually do like:
debtree ... | xdot -
It fails like this:
Traceback (most recent call last):
File "/usr/bin/xdot", line 4, in <module>
main()
File "/usr/lib/python3/dist-packages/xdot/__main__.py", line 75, in main
win.set_dotcode(sys.stdin.read())
File "/usr/lib/python3/dist-packages/xdot/ui/window.py", line 598, in set_dotcode
if self.dotwidget.set_dotcode(dotcode, filename):
File "/usr/lib/python3/dist-packages/xdot/ui/window.py", line 142, in set_dotcode
if self._set_dotcode(dotcode, filename):
File "/usr/lib/python3/dist-packages/xdot/ui/window.py", line 128, in _set_dotcode
assert isinstance(dotcode, bytes)
AssertionError
Luckily, the fix is easy, and already done upstream:
https://github.com/jrfonseca/xdot.py/commit/fc02ef4940a8894472fafba47b21e0df3b3c6315
Just change one line with a patch:
diff --git a/xdot/__main__.py b/xdot/__main__.py
index a7c404b..41ec65e 100755
--- a/xdot/__main__.py
+++ b/xdot/__main__.py
@@ -72,7 +72,7 @@ def main():
win.set_filter(options.filter)
if inputfile and len(inputfile) >= 1:
if inputfile == '-':
- win.set_dotcode(sys.stdin.read())
+ win.set_dotcode(sys.stdin.buffer.read())
else:
win.open_file(inputfile)
Best regards
Ruben
-- System Information:
Debian Release: buster/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 4.9.0-8-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
Versions of packages xdot depends on:
ii gir1.2-gtk-3.0 3.22.30-2
ii graphviz 2.40.1-3
ii python3 3.6.6-1
ii python3-gi 3.28.3-1
ii python3-gi-cairo 3.28.3-1
ii python3-graphviz 0.8.4-2
xdot recommends no packages.
xdot suggests no packages.
-- no debconf information
More information about the Python-apps-team
mailing list