Open ikajic opened 8 years ago
Reproduced the issue in firefox and wrote a selenium test for it. When the issue is fixed the test will update to passed.
Isn't this kind of expected? You're basically stopping the script and dropping into the debug prompt, aren't you?
I agree with Jan. What's the alternative behaviour?
What happens when your code contains "pdb.set_trace" (I recommend trying if you haven't done so) is that your browser gets stuck in "Loading" mode. If you already haven't loaded the GUI, it won't be loaded at all. Currently, to a user this could appear as the GUI is not working, which is wrong.
There are several options:
pdb.set_trace
s (since GUI doesn't support debugging anyway) and pretend
they are not thereThese are just a few things that come to my mind, but it would be helpful to inform a user about the reason why the GUI is not being loaded.
On 15 February 2016 at 21:57, Sean Aubin notifications@github.com wrote:
I agree with Jan. What's the alternative behaviour?
— Reply to this email directly or view it on GitHub https://github.com/nengo/nengo_gui/issues/622#issuecomment-184490239.
I am against a special handle of pdb.set_trace
because there is a more general, or actually two more general problems.
pdb.set_trace
is one way to encounter these problems, but there is a near-infinite number of other ways (and we can't handle each one specifically).
As a partial solution I would propose the following:
There's one thing to check though: I'm not completely sure about the effect of pdb.set_trace
. I would not be surprised if it halts all threads of the Python instance in which case point 1. would not help (except when using a separate process, but that complicates things because of interprocess communication).
If
pdb.set_trace()
appears in the code, as in:the browser hangs with loading. I've tried with: Chromium Version 46.0.2490.71 Built on 8.2 Mozilla Iceweasel 38.4.0