pydev - remote debugging issue

213 views
Skip to first unread message

Zbyněk Fiala

unread,
Sep 1, 2016, 1:46:37 PM9/1/16
to LiClipse

Hi,
thanks for LiClipse, I am testing it now and I have to say finally decent solution for my python scripting adventure.

I would like to kindly ask for any help with  remote debug issue:

I am using LiClipse + PyDev for remote debugging Kodi script in python. I am able to debug fully (watches, breakpoints,variables ...) any plugin,
but only one time. Another attempt for debugging resulting in
Error Type: <type 'exceptions.RuntimeError'>
                                           
Error Contents: classes are read-only in restricted mode
                                           
Traceback (most recent call last):
                                             
File "C:\Users\decak\AppData\Roaming\Kodi\addons\plugin.video.sosac.ph\default.py", line 37, in <module>
                                                pydevd
.settrace('localhost', stdoutToServer=True, stderrToServer=True,trace_only_current_thread=False)
                                             
File "e:\Program Files\Brainwy\LiClipse 3.1.0\plugins\org.python.pydev_5.2.0.201608171655\pysrc\pydevd.py", line 1129, in settrace
                                                patch_multiprocessing
,
                                             
File "e:\Program Files\Brainwy\LiClipse 3.1.0\plugins\org.python.pydev_5.2.0.201608171655\pysrc\pydevd.py", line 1208, in _locked_settrace
                                               
debugger.patch_threads()
                                             
File "e:\Program Files\Brainwy\LiClipse 3.1.0\plugins\org.python.pydev_5.2.0.201608171655\pysrc\pydevd.py", line 845, in patch_threads
                                               
def patch_threads(self):
                                             
File "e:\Program Files\Brainwy\LiClipse 3.1.0\plugins\org.python.pydev_5.2.0.201608171655\pysrc\_pydevd_bundle\pydevd_trace_dispatch.py", line 23, in trace_dispatch
                                               
return _trace_dispatch(py_db, frame, event, arg)
                                             
File "_pydevd_bundle\pydevd_cython_win32_27_32.pyx", line 872, in _pydevd_bundle.pydevd_cython_win32_27_32.trace_dispatch (_pydevd_bundle/pydevd_cython_win32_27_32.c:14458)
                                             
File "e:\Program Files\Brainwy\LiClipse 3.1.0\plugins\org.python.pydev_5.2.0.201608171655\pysrc\pydevd_tracing.py", line 77, in SetTrace
                                               
TracingFunctionHolder._warn = False
                                           
RuntimeError: classes are read-only in restricted mode

Thanks for any clarification
       Zbyněk

LiClipse    3.1.0.201608171655
PyDev for Eclipse    5.2.0.201608171655 

Fabio Zadrozny

unread,
Sep 1, 2016, 2:23:42 PM9/1/16
to Zbyněk Fiala, LiClipse
I think the issue you're having is that the module you're using is using Python in restricted mode (https://docs.python.org/2/library/rexec.html)... 

I don't think there's much that can be done in PyDev -- that functionality of Python itself seems to be deprecated (since 2.6 and removed in Python 3) and the debugger doesn't really support it (i.e.: apparently it's not even possible to set attributes in classes) -- I must say I'm really surprised it worked the first time given that there are probably lots of restrictions on restricted mode.

What you can try to do is changing the code locally to work around the issues it may have to see if you can get farther (i.e.: remove the .pyd files generated on folders below e:\Program Files\Brainwy\LiClipse 3.1.0\plugins\org.python.pydev_5.2.0.201608171655\pysrc\ and treat the exceptions you have in the .py files because of the restricted mode).

Cheers,

Fabio

--
You received this message because you are subscribed to the Google Groups "LiClipse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liclipse+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zbyněk Fiala

unread,
Sep 1, 2016, 2:39:58 PM9/1/16
to LiClipse, zbynek...@gmail.com
Thanks for info.
I appreciate your fast response.
I will try to cope with it in my code.

Dne čtvrtek 1. září 2016 20:23:42 UTC+2 Fabio Zadrozny napsal(a):
To unsubscribe from this group and stop receiving emails from it, send an email to liclipse+u...@googlegroups.com.

Zbyněk Fiala

unread,
Sep 3, 2016, 3:46:01 PM9/3/16
to LiClipse, zbynek...@gmail.com
Remote debugging finally works like a charm including breakpoints:
Sem win7 64bit.

LiClipse 3.1.0.20160817

PyDev for Eclipse 5.2.0.20160817

Kodi (16.1 Git:20160424-c327c53)

+

nabilbendafi/script.module.pydevd https://github.com/nabilbendafi/script.module.pydevd


Dne čtvrtek 1. září 2016 20:39:58 UTC+2 Zbyněk Fiala napsal(a):

Zbyněk Fiala

unread,
Sep 3, 2016, 7:26:44 PM9/3/16
to LiClipse, zbynek...@gmail.com
Just adding a little bit of history:
1. PyDev 5.2 - pyscr in default path in LiClipse
 Remote connection established: OK
 Stop after settrace: OK
 Add breakpoint insertion: OK
 but only for the first addon launch another attempt threw:


LiClipse 3.1.0\plugins\org.python.pydev_5.2.0.201608171655\pysrc\pydevd_tracing.py", line 77, in SetTrace

TracingFunctionHolder._warn = False RuntimeError: classes are read-only in restricted mode

2. Pydev 5.2 + script.module.pydev from https://github.com/powlo/script.module.pydevd compatible with PyDev 3.4.2
 Remote connection established: OK
 Stop after settrace: OK
 Add breakpoint insertion: NOK threw:

Kodi\addons\script.module.pydevd-master\lib\pydevd.py", line 878, in processNetCommand
21:57:49 T:8048   ERROR:     thread_id, frame_id, console_command = text.split('\t', 2)
21:57:49 T:8048   ERROR: ValueError: need more than 1 value to unpack

3. Pydev 5.2 + script.module.pydev from https://github.com/nabilbendafi/script.module.pydevd compatible with PyDev 4.4.0
 Remote connection established: OK
 Stop after settrace: OK
 Add breakpoint insertion: OK
 works like a charm  not only once

Dne sobota 3. září 2016 21:46:01 UTC+2 Zbyněk Fiala napsal(a):
Reply all
Reply to author
Forward
0 new messages