Skip to content

Some variables not assigned when using debug console #915

@ssavary

Description

@ssavary

Issue Type: Bug

Tested on VSCode 1.66.x. Does not seem to occur with 1.65.x

  1. Run some code
  2. stop on a break point.
  3. some variables assigned by code prior to beakpoint (e.g. A = 10, B = 30)
  4. execute a function that returns multiple variable and put into existing variables in local context (e.g. A, B = some_fun())
  5. A does not get assigned with a new value.

Here is some code that reproduces the problem (with line numbers). Set a breakpoint on line

import numpy as np

def some_fun():
    return np.random.randn(), np.random.randn()

def some_fun_2():
    return np.random.randn()

def main():
    A = 10
    B = 34
    C = 11

    A, B = some_fun() # this assignment works when stepping
    print(A) # break on this line

Once the code has stopped on breakpoint, execute A, B = some_fun() in the Debug Console to experiment the bug.

These have the same erroneous behaviour:
A, B = np.random.randn(), np.random.randn()
B, A = np.random.randn(), np.random.randn()
B, A = some_fun()

However, A = some_fun_2() works fine.

python 3.8.10
Extension version: 2022.4.1
VS Code version: Code 1.66.2 (dfd34e8260c270da74b5c2d86d61aee4b6d56977, 2022-04-11T07:49:20.994Z)
OS version: Darwin x64 20.6.0
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 x 2600)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 3, 3, 3
Memory (System) 32.00GB (0.06GB free)
Process Argv --crash-reporter-id 2a273040-cc5d-49bc-b505-46f4293dc6a3 --crash-reporter-id 2a273040-cc5d-49bc-b505-46f4293dc6a3
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
vscaat:30438848

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions