First time here? Check out the FAQ!
1

Problem with Wing debugging a python script from terminal

in Ubuntu 20.04 I want to lauch a python script from terminal window as sudo. I use wingdbstub and it starts OK. I would like the output and input (especially password inputs) to be done from the terminal window. in the debugger preferences. I clicked on the use external console . I added the exo-open --launch TerminalEmulator . Now I can start the program from the terminal window . At first break point I get into the wing debugger and the breakpoint works. But inside a subprocess.run, the debugger does not use the terminal window to ask for password. and keeps waiting for the password!....

piscvau's avatar
486
piscvau
asked 2022-04-02 09:17:10 -0600
Wingware Support's avatar
4k
Wingware Support
updated 2023-01-05 08:35:55 -0600
edit flag offensive 0 remove flag close merge delete

Comments

That's odd and sounds like it may be a bug. Does it work if you uncheck the Debugger > Advanced > Use sys.std Wrapper preference?

Wingware Support's avatar Wingware Support (2022-04-06 08:04:52 -0600) edit

Thanks for our quick response. I cannot try again right now because I modified my project structure and I am no longer able to launch the python script. I will come back later to this.

piscvau's avatar piscvau (2022-04-07 05:50:34 -0600) edit

yes it works if I unclick the sys.std wrapper

piscvau's avatar piscvau (2022-04-08 13:45:52 -0600) edit
add a comment see more comments

2 Answers

0

Python has a debugger , which is available as a module called pdb . It supports setting conditional breakpoints , stepping through the source code one line at a time, stack inspection, and more.

import pdb
msg = "this is a test"
pdb.set_trace()
print(msg)

Insert pdb.set_trace() anywhere and it will function as a breakpoint . When you execute the script by python test.py, you will in the python debug mode.

doniervask's avatar
3
doniervask
answered 2023-01-05 00:35:42 -0600
edit flag offensive 0 remove flag delete link

Comments

The question was specifically about using Wing's debugger for this. I've tried to clarify this in the question title for others that might find this post, since I see it was confusing before. Wing's wingdbstub works similarly to pdb but gives access to the full IDE UI for inspecting data and interacting with the debug process. Details are at https://wingware.com/doc/debug/debugg...

Wingware Support's avatar Wingware Support (2023-01-05 08:40:01 -0600) edit
add a comment see more comments
0

Sounds like this is a bug that can be worked around by unchecking the Debugger > Advanced > Use sys.stdin Wrapper preference. I think the problem is that it is getting confused in the child processes about whether it's running in Wing's Debug I/O tool or an external console. Thanks for reporting this problem!

Wingware Support's avatar
4k
Wingware Support
answered 2022-04-08 14:40:07 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer