Skip to content

VS Code python extension will modify my data in Python script when i debug with it #2101

@sherlockchou86

Description

@sherlockchou86

Environment data

  • VS Code version: 1.19.3
  • Extension version (available under the Extensions sidebar): 2018.4.0 (2 May 2018)
  • OS and version: windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): python 3.5.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: XXX

the VS Code IDE will modify my property in Python script when i debug with it. my test code as below

bytesIO = io.BytesIO(...)
bytesIO.seek(0)
print(bytesIO.realine()) # will output the first line

Actual behavior

print(bytesIO.readline()) output nothing.

Expected behavior

print(bytesIO.readline()) will output the first line.

if i add bytesIO.seek(0) after i watch the variable by vs code ide, the output is right. I wander if the IDE has modified the data inside the bytesIO object, such as it called its iterator and changed the position flag inside the object.

hope it helps!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-debuggingbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions