Comments (6)
Thanks @RedGuy12, I was just starting to try and minimize when you posted that :)
I used py-spy to figure out what Black is doing, and it's just stuck in the tokenizer:
So it's somewhere in generate_tokens()
. That's a big function. I'll spend some time tonight trying to figure it out; in the meantime cc @tusharsadhwani.
from black.
@JelleZijlstra using python -m blib2to3.pgen2.tokenize foo.py
on the minimal reproduction should show the last token generated, and you can step into the debugger from there onwards.
I'm looking into the issues as well now.
from black.
Can reproduce on Python 3.11.4 only running Black on the sdk-extension/opentelemetry-sdk-extension-aws/tests
folder
from black.
Minimum reproducible example seems to be:
f'{{\\"kind\\":\\"ConfigMap\\",\\"metadata\\":{{\\"annotations\\":{{}},\\"name\\":\\"cluster-info\\",\\"namespace\\":\\"amazon-cloudwatch\\"}}}}'
Black 24.4.1, stable style, all default options
from black.
Fix in #4331.
from black.
Thanks!
from black.
Related Issues (20)
- Cannot parse multiline f-string containing multiline string HOT 1
- Is there any way to have a permalink for a specific version in the changelog doc? HOT 5
- Unnecessary parentheses added to expression in indexed assignment
- "EOF in multi-line string" on string containing same quote nested in f-string HOT 2
- Failure to format when double-quotes are in an f-string's code block HOT 8
- Long lines that concatenate list comprehensions HOT 3
- Black Formatter not working for this code. HOT 2
- Python 3.12 `def f[T: Generics](...)` HOT 2
- Strings not being formatted by Black HOT 3
- Black fails to format string which has '='s etc HOT 2
- Black v24.4.1 & v24.4.2 fails to format f-strings containing multi-line strings HOT 1
- Advice (UFMT) command-failed Failed due to ASTSafetyError HOT 2
- fmt: skip is required at the line which follows the one incorrectly formatted
- Error in github actions when using `use_pyproject: true` HOT 2
- Error: Invalid value for 'SRC ...': Path '...' does not exist. HOT 2
- Technical doc for smoother contribution
- import asyncio HOT 4
- no info about setting by default HOT 3
- Black fails to format triple quoted string with a new line in f-string.
- Black produces invalid code for assignment with over-long starred expression HOT 2
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.