Skip to content

Formatting fails to update files due to path quoting issues #14078

@CodePidgy

Description

@CodePidgy

Black seems to not be working, and initially I thought it was a bug in my code or something, but running python -m black main.py works just fine. What's happening?

Environment data

  • VS Code version: 1.49.1
  • Extension version (available under the Extensions sidebar): v2020.9.111407
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: black: 20.8b1
  • Relevant/affected Python-related VS Code extensions and their versions: None
  • Value of the python.languageServer setting: Jedi

Expected behaviour

Code to be formatted after running "Format Document" (Shift+Alt+F).

Actual behaviour

Black runs for a split second and nothing happens.

Steps to reproduce:

  1. Have a line over 80 characters long which should be formatted
  2. Run formatter
  3. Be dissapointed at your still ugly code.

Logs

Details
> f:\Programs\Python\Lynez Experiment\env\Scripts\python.exe "D:/Data/Microsoft Visual Studio Code/extensions/ms-python.python-2020.9.111407/pythonFiles/pyvsc-run-isolated.py" black --diff --quiet "f:\Programs\Python\Lynez Experiment\main.py"
cwd: f:\Programs\Python\Lynez Experiment
> f:\Programs\Python\Lynez Experiment\env\Scripts\python.exe "D:/Data/Microsoft Visual Studio Code/extensions/ms-python.python-2020.9.111407/pythonFiles/pyvsc-run-isolated.py" black --diff --quiet "f:\Programs\Python\Lynez Experiment\main.py"
cwd: f:\Programs\Python\Lynez Experiment

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions