Giter Site home page Giter Site logo

Comments (6)

sebw avatar sebw commented on August 23, 2024 1

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.

joslarson avatar joslarson commented on August 23, 2024 1

@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.

joslarson avatar joslarson commented on August 23, 2024 1

@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.

joslarson avatar joslarson commented on August 23, 2024

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.

blackrobot avatar blackrobot commented on August 23, 2024

@joslarson:

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.

joslarson avatar joslarson commented on August 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.