Winpdb with Python 3.3

1,170 views
Skip to first unread message

Marcus Weigand

unread,
Mar 29, 2013, 4:21:52 PM3/29/13
to win...@googlegroups.com
Is it possible to use Winpdb with Python 3.3? On the wxPython website I can only find binaries up to Python 2.7.

Thanks,
Marcus

Bluebird

unread,
Apr 1, 2013, 5:01:25 AM4/1/13
to win...@googlegroups.com
The graphical interface of Winpdb depends on WxPython, which has not yet been ported to Python 3.3 . There is an effort in this direction, along with many changes to the internals of WxPython, known as the Project Phoenix ( http://wiki.wxpython.org/ProjectPhoenix ). As part of that project, you can find daily snapshots of WxPython . It might be that Winpdb is already working with this version since the changes are minimal but nobody has tried yet.

As an alternative, you can still debug a Python 3.3 program with the graphical interface running in the current version of winpdb.

Start your python 3.3 program with winpdb in the "debugee" mode :
D:\work\winpdb\winpdb-git>C:\Python33\python.exe  rpdb2.py --debuggee --pwd=totoro toto.py

Then start winpdb to attach to the running debugee :
D:\work\winpdb\winpdb-git>C:\Python27\python.exe  winpdb.py --attach --pwd totoro --host localhost toto.py

And voila, you can debug toto.py

Philippe

Marcus Weigand

unread,
Apr 1, 2013, 11:01:10 PM4/1/13
to win...@googlegroups.com
Thanks lots, Philippe!

ccandide

unread,
Aug 29, 2013, 7:01:07 PM8/29/13
to win...@googlegroups.com


Start your python 3.3 program with winpdb in the "debugee" mode :
D:\work\winpdb\winpdb-git>C:\Python33\python.exe  rpdb2.py --debuggee --pwd=totoro toto.py

Then start winpdb to attach to the running debugee :
D:\work\winpdb\winpdb-git>C:\Python27\python.exe  winpdb.py --attach --pwd totoro --host localhost toto.py


Thanks Philippe for your info.

Here is the equivalent of the above commands on my Ubuntu 12.10. I suppose toto.py is a Python 3 source file:

$ python3.2 /usr/lib/python2.7/dist-packages/rpdb2.py --debuggee  toto.py
A password should be set to secure debugger client-server communication.
Please type a password:x
Password has been set.


In another console, launch the following :

$ python /usr/lib/python2.7/dist-packages/winpdb.py --attach --host localhost toto.py
A password should be set to secure debugger client-server communication.
Please type a password:x
Password has been set.

This automatically opens the toto.py file within the winpdb graphic interface.

The debugging seems to work fine (I tested with a true Python 3 file, one containing Python 3 specific code and not compatible with Python 2).

Philippe

unread,
Aug 30, 2013, 6:16:33 AM8/30/13
to win...@googlegroups.com
On 30/08/2013 01:01, ccandide wrote:


Start your python 3.3 program with winpdb in the "debugee" mode :
D:\work\winpdb\winpdb-git>C:\Python33\python.exe  rpdb2.py --debuggee --pwd=totoro toto.py

Then start winpdb to attach to the running debugee :
D:\work\winpdb\winpdb-git>C:\Python27\python.exe  winpdb.py --attach --pwd totoro --host localhost toto.py


Thanks Philippe for your info.

I also started to work on adapting winpdb for Python 3.x . There are some very minor changes to support the new major versions of Python but this can be covered with one codebase.

However, the graphical interface will not work with Python 3 until WxPython supports Python 3.

Anyway, you can check at the branch experiment_test on the github project : https://github.com/bluebird75/winpdb/commits/experiment_test

cheers,

Philippe

Chiel ten Brinke

unread,
Dec 23, 2013, 1:37:01 PM12/23/13
to win...@googlegroups.com
For me this only works for python 3.2.
For python 3.3 I get the following error:

$ python3.3 /usr/lib/pymodules/python2.7/rpdb2.py --debuggee /home/chiel/Projects/fate-tui/fate
A password should be set to secure debugger client-server communication.
Please type a password:x
Password has been set.
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/rpdb2.py", line 14499, in <module>
    ret = rpdb2.main()
  File "/usr/share/pyshared/rpdb2.py", line 14470, in main
    StartServer(_rpdb2_args, fchdir, _rpdb2_pwd, fAllowUnencrypted, fAllowRemote, secret)
  File "/usr/share/pyshared/rpdb2.py", line 14212, in StartServer
    g_module_main = -1
  File "/usr/share/pyshared/rpdb2.py", line 14212, in StartServer
    g_module_main = -1
  File "/usr/share/pyshared/rpdb2.py", line 7324, in trace_dispatch_init
    self.__set_signal_handler()
  File "/usr/share/pyshared/rpdb2.py", line 7286, in __set_signal_handler
    handler = signal.getsignal(value)
  File "/usr/share/pyshared/rpdb2.py", line 13682, in __getsignal
    handler = g_signal_handlers.get(signum, g_signal_getsignal(signum))
ValueError: signal number out of range

Any idea why, or how this can be fixed?

Bluebird

unread,
Dec 25, 2013, 4:12:54 PM12/25/13
to win...@googlegroups.com
Hi


Le lundi 23 décembre 2013 19:37:01 UTC+1, ctenbrinke a écrit :
For me this only works for python 3.2.
For python 3.3 I get the following error:

$ python3.3 /usr/lib/pymodules/python2.7/rpdb2.py --debuggee /home/chiel/Projects/fate-tui/fate
A password should be set to secure debugger client-server communication.
Please type a password:x
Password has been set.
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/rpdb2.py", line 14499, in <module>
    ret = rpdb2.main()
  File "/usr/share/pyshared/rpdb2.py", line 14470, in main
    StartServer(_rpdb2_args, fchdir, _rpdb2_pwd, fAllowUnencrypted, fAllowRemote, secret)
  File "/usr/share/pyshared/rpdb2.py", line 14212, in StartServer
    g_module_main = -1
  File "/usr/share/pyshared/rpdb2.py", line 14212, in StartServer
    g_module_main = -1
  File "/usr/share/pyshared/rpdb2.py", line 7324, in trace_dispatch_init
    self.__set_signal_handler()
  File "/usr/share/pyshared/rpdb2.py", line 7286, in __set_signal_handler
    handler = signal.getsignal(value)
  File "/usr/share/pyshared/rpdb2.py", line 13682, in __getsignal
    handler = g_signal_handlers.get(signum, g_signal_getsignal(signum))
ValueError: signal number out of range

Any idea why, or how this can be fixed?


Not really, but I'll have a look at it sometimes. The problem does not show up on Windows but Windows does not support signals, so that's normal. I don't see any impacting changes listed in Python 3.3 on the signal module.

Can you check if this reproduces the problem, to be run from a checkout of winpdb on branch experiment_test at github : https://github.com/bluebird75/winpdb/tree/experiment_test

python rpdb2.py --debug --debuggee tests/debugme.py

I don't have access to a linux box right now so it will be difficult to have a look at this quickly.

cheers,

Philippe

 

Chiel ten Brinke

unread,
Dec 27, 2013, 5:23:47 AM12/27/13
to win...@googlegroups.com
Thank you for your reply. I couldn't switch to experiment_test branch, so here's the output of your command on master branch.

chiel@ENIAC:~/Projects$ python3.3 winpdb/rpdb2.py --debug --debuggee ~/foo.py
A password should be set to secure debugger client-server communication.
Please type a password:x
Password has been set.
11:22:35.104 rpdb2.py:14178 in StartServer: Starting server with: /home/chiel/foo.py
Traceback (most recent call last):
  File "winpdb/rpdb2.py", line 14499, in <module>
    ret = rpdb2.main()
  File "/home/chiel/Projects/winpdb/rpdb2.py", line 14470, in main
    StartServer(_rpdb2_args, fchdir, _rpdb2_pwd, fAllowUnencrypted, fAllowRemote, secret)
  File "/home/chiel/Projects/winpdb/rpdb2.py", line 14212, in StartServer
    g_module_main = -1
  File "/home/chiel/Projects/winpdb/rpdb2.py", line 14212, in StartServer
    g_module_main = -1
  File "/home/chiel/Projects/winpdb/rpdb2.py", line 7324, in trace_dispatch_init
    self.__set_signal_handler()
  File "/home/chiel/Projects/winpdb/rpdb2.py", line 7286, in __set_signal_handler
    handler = signal.getsignal(value)
  File "/home/chiel/Projects/winpdb/rpdb2.py", line 13682, in __getsignal
    handler = g_signal_handlers.get(signum, g_signal_getsignal(signum))
ValueError: signal number out of range
11:22:35.198 rpdb2.py:14030 in _atexit: Entered _atexit() in pid 3422
11:22:36.199 rpdb2.py:9612 in stop: Stopping IO server... (pid = 3422)
11:22:37.979 rpdb2.py:9286 in shutdown: Shutting down worker queue...
11:22:37.980 rpdb2.py:9303 in shutdown: Shutting down worker queue, done.
11:22:37.980 rpdb2.py:9634 in stop: Stopping IO server, done.




--
You received this message because you are subscribed to a topic in the Google Groups "Winpdb" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/winpdb/J9rUYIvlkE0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to winpdb+un...@googlegroups.com.
To post to this group, send email to win...@googlegroups.com.
Visit this group at http://groups.google.com/group/winpdb.
For more options, visit https://groups.google.com/groups/opt_out.

Vasily Galkin

unread,
Mar 4, 2014, 2:19:31 AM3/4/14
to win...@googlegroups.com
It's due constants SIG_BLOCK, etc added in python3.3 to signals module. Attached patch fixes this problem to me. Though, I've not perform a lot of testing.

понедельник, 23 декабря 2013 г., 22:37:01 UTC+4 пользователь ctenbrinke написал:
rpdb2_py3.3.patch

郭晓辉

unread,
Mar 30, 2015, 1:45:03 AM3/30/15
to win...@googlegroups.com
Really cool patch. fix the problem in my environment perfectly. many thanks.

在 2014年3月4日星期二 UTC+8下午3:19:31,Vasily Galkin写道:
Reply all
Reply to author
Forward
0 new messages