Skip to content

Opening Python file after window reload overwrites file with contents of settings.json #716

Closed
@singularitti

Description

@singularitti

Type: Bug

Bug Description

When the Python extension is enabled, and I open a Python file in the editor, then reload the VSCode window (Developer: Reload Window), the contents of my settings.json file are copied into the Python file, completely overwriting its original content.

This is very disruptive and has led to loss of code. The behavior does not occur when the Python extension is disabled.

Steps to Reproduce

  1. Open VSCode with the Python extension enabled.
  2. Open any .py file.
  3. Ensure that you also have a settings.json (with some identifiable content).
  4. Use the Developer: Reload Window command.
  5. Observe that the Python file content gets replaced with the contents of settings.json.

What I’ve Tried

  • I ran the Extension Bisect tool and confirmed that this issue is caused by the Python extension.
  • Disabling the extension prevents the issue from happening.
  • This does not appear to be caused by any other extensions.

VSCode & Extension Info

  • VSCode version:
Version: 1.100.2
Commit: 848b80aeb52026648a8ff9f7c45a9b0a80641e2e
Date: 2025-05-14T21:47:40.416Z
Electron: 34.5.1
ElectronBuildId: 11369351
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0
  • Python extension version: 2025.6.1
  • OS: macOS 15.5 (24F74)

Extension version: 2025.8.0
VS Code version: Code 1.100.2 (848b80aeb52026648a8ff9f7c45a9b0a80641e2e, 2025-05-14T21:47:40.416Z)
OS version: Darwin arm64 24.5.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.3
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions