You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my settings are the following :
"python.formatting.provider": "black",
"python.formatting.blackPath": "C:/SafApp/Python/Python3.10-64/Scripts/black.exe",
"python.formatting.blackArgs": [
"--preview"
],
"[python]": {
"editor.defaultFormatter": null
},
"editor.formatOnSave": true,
black works perfectly when used by command line, but the command launched by the formatOnSave seems wrong to me. As a result black doesn't format my files on save.
when saving the file pandas_loc.py :
Output tab [Python]:
C:/SafApp/Python/Python3.10-64/Scripts/black.exe --preview --diff --quiet .\pandas_loc.py.40996521066352b2ddb99ea0eda2de46.tmp
cwd: .
... and my file is not formatted
i tried the command in the vscode integrated terminal and got :
Usage: black [OPTIONS] SRC ...
Try 'black -h' for help.
Error: Invalid value for 'SRC ...': Path '.\pandas_loc.py.40996521066352b2ddb99ea0eda2de46.tmp' does not exist.
I guess the tmp file should be the output but black is trying to format the unexisting tmp file.
Hope you can help
Extension version: 2022.0.1814523869
VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:02:28.252Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
System Info
Item
Value
CPUs
11th Gen Intel(R) Core(TM) i5-11500H @ 2.90GHz (12 x 2918)
@Laufron This occurs because we try to figure out the formatting changes on a file, using a temp file. If the temp file creation failed for some reason, then you run into this error.
We have been working on creating black formatter extension that will handle this differently. This issue will be addressed by that extension when it gets released. If you want to try it out, you can find it here. psf/black#2883
Issue Type: Bug
my settings are the following :
"python.formatting.provider": "black",
"python.formatting.blackPath": "C:/SafApp/Python/Python3.10-64/Scripts/black.exe",
"python.formatting.blackArgs": [
"--preview"
],
"[python]": {
"editor.defaultFormatter": null
},
"editor.formatOnSave": true,
black works perfectly when used by command line, but the command launched by the formatOnSave seems wrong to me. As a result black doesn't format my files on save.
when saving the file pandas_loc.py :
Output tab [Python]:
i tried the command in the vscode integrated terminal and got :
Usage: black [OPTIONS] SRC ...
Try 'black -h' for help.
Error: Invalid value for 'SRC ...': Path '.\pandas_loc.py.40996521066352b2ddb99ea0eda2de46.tmp' does not exist.
I guess the tmp file should be the output but black is trying to format the unexisting tmp file.
Hope you can help
Extension version: 2022.0.1814523869
VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:02:28.252Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: