jrfonseca/xdot.py

Python 3: Hidden AttributeError

overminder opened this issue · 1 comments

Hi, first I'd like to thank you for creating such an useful tool for interactive dot viewing! My first use of this tool was 6 years ago, to view the control flow graphs generated from some compilers.

Today I encountered a small logical bug at https://github.com/jrfonseca/xdot.py/blob/427cd4b/xdot/ui/window.py#L112, where it sets error to be a str while in the other branch (on L115) error is set to be a bytes (as no encoding or errors is set in subprocess.Popen above). Then on L118 there's a error.decode() which is only valid for bytes but not for str, which in my case triggers this bug.

One way to fix this is just to move the decode statement to the branch on L115.

I'm glad to hear you find it useful. You're absolutely right on the issue described. It could easily happen if dot is not installed. I finally fixed, as suggested. Sorry for the delay.