Comments (6)
Same problem here. Exact same stacktrace.
Black works from the command line:
$ python3 -m black -l 88 .
reformatted /Users/sw/Desktop/test.py
from black-vscode.
@octohedron @sebw Sorry for the slow response guys! I messed up my notification settings and wasn't getting notified about issues on this repo.
This seems related to #9 which I published a hacky fix for a while back, but I'm not sure why it's not working for you.
TLDR: it's actually an issue with VS Code
Some workarounds are mention in #9 such as launching VS Code from your terminal instead of the dock/finder or hacking your black path to set the locale.
Also, Black formatting support just landed in the latest official Python extension, so you might want to switch to that, though I'm unsure whether it will fix your issue. My plan all along has been to deprecate this extension once the official Python extension added support for Black. Let me know if there's any reason I shouldn't go ahead with that course of action.
from black-vscode.
@blackrobot The only work around that I can figure out is to launch vscode from your teminal using the code
command: https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line
When you do that VS Code will inherit your system's locale settings. That's how I work anyways, so I've never run into this issue.
from black-vscode.
I'm going to go ahead close this since, from what I understand, switching to the official Python extension solves the issue, and I'm going to move forward with deprecating this extension. Thanks!
from black-vscode.
from what I understand, switching to the official Python extension solves the issue
Unfortunately, this does not seem to be the case for me, as I wrote in microsoft/vscode-python#1980.
Do you know what change in the official repos should have fixed this issue?
And, would you have any suggestions for working around this bug while using the official extension?
In the meantime, your extension is still working – thank you!
from black-vscode.
@blackrobot thanks for the info, I've reopened this (I don't know of any specific changes, no). With the official extension have you tried setting your blackPath to LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 /Users/damon/.pyenv/versions/3.6.5/bin/black
?
from black-vscode.
Related Issues (15)
- Can't find black when installed into venv HOT 3
- Coudn't make it work in VSCODE HOT 1
- Support black optional flags HOT 1
- Broken by black==18.6b0 HOT 1
- Support for suppressing unable to parse error message HOT 2
- CLI output appended to source file HOT 1
- `Failed to format: unknown error.` on every attempt to format HOT 8
- Configurable black path HOT 5
- Command "black" not found. Try 'pip install black'. HOT 16
- Add instructions on how to format in VS Code to README HOT 5
- Format Document does nothing HOT 6
- black version 18.4a0 "outdated" HOT 6
- Support env variable expansion in "python.pythonPath" setting HOT 4
- Broken on OSX when launching VS Code from finder/dock: not picking up system locale HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from black-vscode.