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

fix incorrect exception raised while processing a list that exceeds MAX_ITEMS_TO_HANDLE #1301

Closed
baek9 opened this issue Apr 3, 2019 · 0 comments

Comments

@baek9
Copy link
Contributor

baek9 commented Apr 3, 2019

Environment data

  • PTVSD version: 4.2.6
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7.6
  • Using VS Code or Visual Studio: VS Code

Actual behavior

in VS Code, I ran following code and set a breakpoint to the print line and expand the lst in the debugging window. the code is:

lst = {}
for idx in range(0, 400):
    lst[idx] = ("blah")

print "break here and expand the lst in the debugging window"

And give this traceback:

Traceback (most recent call last):
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_frame.py", line 590, in
trace_dispatch
    self.do_wait_suspend(thread, frame, event, arg)
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\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\test\.vscode\extensions\ms-python.python-2019.3.6352\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\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py", line 1307, in _do_wait_suspend
    self.process_internal_commands()
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py", line 1024, in process_internal_commands
    int_cmd.do_it(self)
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\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\test\.vscode\extensions\ms-python.python-2019.3.6352\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\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_suspended_frames.py", line 108, in get_children_variables
    for key, val, evaluate_name in lst:
ValueError: need more than 2 values to unpack
Traceback (most recent call last):
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\ptvsd_launcher.py", line 45, in <module>
    main(ptvsdArgs)
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\__main__.py", line 391, in main
    run()
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\__main__.py", line 272, in run_file
    runpy.run_path(target, run_name='__main__')
  File "C:\Python27\lib\runpy.py", line 252, in run_path
    return _run_module_code(code, init_globals, run_name, path_name)
  File "C:\Python27\lib\runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "d:\test.py", line 5, in <module>
    print "break here and expand the lst in debugging window"
  File "d:\test.py", line 5, in <module>
    print "break here and expand the lst in debugging window"
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_frame.py", line 590, in
trace_dispatch
    self.do_wait_suspend(thread, frame, event, arg)
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\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\test\.vscode\extensions\ms-python.python-2019.3.6352\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\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py", line 1307, in _do_wait_suspend
    self.process_internal_commands()
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\_vendored\pydevd\pydevd.py", line 1024, in process_internal_commands
    int_cmd.do_it(self)
  File "c:\Users\test\.vscode\extensions\ms-python.python-2019.3.6352\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\test\.vscode\extensions\ms-python.python-2019.3.6352\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\test\.vscode\extensions\ms-python.python-2019.3.6352\pythonFiles\lib\python\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_suspended_frames.py", line 108, in get_children_variables
    for key, val, evaluate_name in lst:
ValueError: need more than 2 values to unpack

Expected behavior

No exception, No debugging stops, Expand the list and show all items in the list.

Steps to reproduce:

See above.

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

No branches or pull requests

1 participant