pudb icon indicating copy to clipboard operation
pudb copied to clipboard

Variable printing in command line messes up ui

Open thomasarvanitidis opened this issue 5 years ago • 5 comments

This happens consistently on my machine. To reproduce:

  1. pip install tensorflow
  2. pudb3 pudberror.py
  3. set breakpoint on line 5
  4. print x twice in command line

pudberror.py

import tensorflow as tf

x = tf.compat.v1.placeholder(tf.float32, shape=(1024, 1024))

print(x)

Screenshot 2019-07-12 at 10 24 35 Screenshot 2019-07-12 at 10 25 00

thomasarvanitidis avatar Jul 12 '19 09:07 thomasarvanitidis

Could you figure out which string exactly is causing the breakage? Why do you have to print the string twice?

inducer avatar Jul 12 '19 14:07 inducer

It's not that I have to do that, but I've had this issue with random, not identical objects during inspection (printing). This was just the easiest way I could reproduce it. I've only come across your package yesterday and I don't know how to figure out what you're asking me. Maybe give me some more info?

Additionally, I have the feeling that pudb behaves better on my personal 15" 2015 Macbook than my work 15" touchar Macbook. However, my environments in terms of python versions, venvs, etc. are identical. Idk what I should be paying attention to.

Ps. Huge fan of your solution.

thomasarvanitidis avatar Jul 12 '19 15:07 thomasarvanitidis

I tried reproducing this bug and didn't manage to do so successfully. Here is exactly what I did, perhaps I did something different?

  1. Create new env in conda
  2. Installed most up to date version of pudb on master branch. I also retried this again by installing it with pip.
  3. pip install tensorflow
  4. pudb3 pudberror.py
  5. set breakpoint on line 3 and 5 (you said just 5, but your image shows 3 with a breakpoint and 5 without one). I also tried just having a breakpoint on 3 and none on 5 without success in recreating this bug.
  6. press "c" to continue to line 3
  7. press "c" to continue to line 5
  8. print x twice in command line

352

Jbwasse2 avatar Jul 16 '19 18:07 Jbwasse2

This looks like the same issue as https://github.com/inducer/pudb/issues/166. Are you using the system Python or the python.org Python?

Can you try my fix at https://github.com/inducer/pudb/pull/350 to see if it makes the problem go away?

asmeurer avatar Jul 17 '19 16:07 asmeurer

@asmeurer, I am using python.org as I have to stick to 3.6.5 and last time I checked system was not that and brew had progressed. I tried installing from source to test your #350 fix, but I still get the same issue. I went through #166 and I got the same $TERM (xterm-256color) like most people. As you mention in https://github.com/inducer/pudb/issues/166#issuecomment-285179044, I can continue typing commands in the dark and, interestingly, if I restart the debugging session the issue goes away and I can print x all I want! My issue does look similar to #166, dunno if you prefer to continue the discussion there.

@Jbwasse2, the only difference I can see in our setup so far is you're using conda's python, but that shouldn't be a limitation anyway.

thomasarvanitidis avatar Jul 30 '19 09:07 thomasarvanitidis