Skip to content

Django app behaves differently when debugging #204

Closed
@DonJayamanne

Description

@DonJayamanne

From @albertinix on October 19, 2017 8:1

Environment data

VS Code version: 1.17.2
Python Extension version: 0.7.0
Python Version: 3.6.0
OS and version: Windows 7 64-bit

Actual behavior

I have a Django app, with a view and a form.
The interesting part is here:

loginForm = LoginForm(request.POST or None)

If I set a breakpoint at that line and then skip over it (with F10), then the loginForm object will not be bound (the is_bound property of the form is false).
If however I set the breakpoint one line after that, the loginForm object will be bound.

This is just one example. It happens multiple times over various objects and functions: if I set the breakpoint at one line when calling a function, the result will be "a" (not expected), while if I set the breakpoint after that line, the result is the expected "b".

The debugger seems, in some cases, to introduce some kind of mistakes in code execution.

P.S.: I checked the same app in PyCharm Community and it behaves as it should, debugger or no debugger.

Copied from original issue: DonJayamanne/pythonVSCode#1327

Metadata

Metadata

Assignees

Labels

area-debuggingbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions