Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

pydevd_resolver.py: "unsupported operand type(s) for +: 'dict' and 'list'" in TupleResolver.get_contents_debug_adapter_protocol throws #1277

Closed
aorcl opened this issue Mar 29, 2019 · 1 comment

Comments

@aorcl
Copy link

aorcl commented Mar 29, 2019

Environment data

  • PTVSD version: python-2019.3.6139
  • OS and version: Windows10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.2.64 standard python
  • Using VS Code or Visual Studio: VSCode

Actual behavior

When trying to inspect a collection during debug, the variable inspector hangs and throws a message

Expected behavior

Inspection working

Steps to reproduce:

  1. Start debugging a program that uses collections module.
  2. Trying to inspect a collections variable throws "unsupported operand type(s) for +: 'dict' and 'list'":
Traceback (most recent call last):  File "c:\Users\adolgano\.vscode\extensions\ms-python.python-2019.3.6139\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_frame.py", line 695, in trace_dispatch
    self.do_wait_suspend(thread, frame, event, arg)
  File "c:\Users\adolgano\.vscode\extensions\ms-python.python-2019.3.6139\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_frame.py", line 78, in do_wait_suspend
    self._args[0].do_wait_suspend(*args, **kwargs)
  File "c:\Users\adolgano\.vscode\extensions\ms-python.python-2019.3.6139\pythonFiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py", line 1285, in do_wait_suspend
    keep_suspended = self._do_wait_suspend(thread, frame, event, arg, suspend_type, from_this_thread, frames_tracker)
  File "c:\Users\adolgano\.vscode\extensions\ms-python.python-2019.3.6139\pythonFiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py", line 1307, in _do_wait_suspend
    self.process_internal_commands()
  File "c:\Users\adolgano\.vscode\extensions\ms-python.python-2019.3.6139\pythonFiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py", line 1024, in process_internal_commands
    int_cmd.do_it(self)
  File "c:\Users\adolgano\.vscode\extensions\ms-python.python-2019.3.6139\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 485, in do_it
    self.method(dbg, *self.args, **self.kwargs)
  File "c:\Users\adolgano\.vscode\extensions\ms-python.python-2019.3.6139\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 655, in internal_get_variable_json
    for child_var in variable.get_children_variables(fmt=fmt):
  File "c:\Users\adolgano\.vscode\extensions\ms-python.python-2019.3.6139\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_suspended_frames.py", line 97, in get_children_variables
    lst = resolver.get_contents_debug_adapter_protocol(self.value, fmt=fmt)
  File "c:\Users\adolgano\.vscode\extensions\ms-python.python-2019.3.6139\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_resolver.py", line 374, in get_contents_debug_adapter_protocol
    ret = from_default_resolver + ret
TypeError: unsupported operand type(s) for +: 'dict' and 'list'

The code tries indeed to add a list to a dict with a '+'

if from_default_resolver:
    ret = from_default_resolver + ret
return ret
@aorcl
Copy link
Author

aorcl commented Apr 2, 2019

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants