Black
Dev ToolsThe uncompromising Python code formatter
Release History
26.1.0Breaking4 fixes11 featuresThis release introduces the 2026 stable style, bringing numerous formatting improvements and fixes, and updates the underlying ignore logic to precisely match Git's behavior regarding `.gitignore` patterns.
26.1a13 fixes8 featuresBlack introduces a preview of the 2026 stable style with several new formatting options and bug fixes, while remaining backward compatible.
25.12.0Breaking8 fixes3 featuresBlack 25.12.0 drops Python 3.9 support, adds several bug fixes, introduces draft 2026 style, and enhances packaging and GitHub Action integration.
25.11.07 fixes10 featuresBlack 24.x introduces Python 3.14 support, new formatting options, arm64 binaries, and a BlackD client, while fixing several comment and Vim‑related bugs.
25.9.0Breaking16 fixes7 featuresThis release drops support for Python <3.7, adds several new formatting capabilities and performance improvements, and fixes numerous crashes and edge‑case bugs.
25.1.013 fixes8 featuresThe 2025 stable style release adds numerous formatting refinements, new features like generic function definition handling and license metadata, performance improvements, and several bug fixes across stable, preview, and integration components.
Common Errors
FileNotFoundError1 reportFileNotFoundError in Black often arises when the program attempts to access a file at a specified path, but that file doesn't exist at that location. To fix this, ensure the file path used by Black (specified in command-line arguments or configuration files) is correct and that the file actually exists in the expected directory. If using prebuilt binaries, especially after extraction or installation processes, verify that all necessary files were extracted or installed successfully and are accessible in their expected locations.
GitIgnorePatternError1 reportGitIgnorePatternError usually arises from invalid patterns in your `.gitignore` file, particularly those incompatible with the pathspec library used by Black. Resolve this by carefully reviewing your `.gitignore` file, correcting or removing any malformed patterns like those with unescaped special characters or syntax errors, and then retry running Black. Using online `.gitignore` validators can help identify problematic entries.
AttributeError1 reportThe `AttributeError: 'tuple' object has no attribute 'append'` in Black often arises when a function expects a mutable list but receives an immutable tuple instead, particularly when manipulating target versions. To fix this, ensure that you're converting the tuple of target versions into a list before attempting to use the `append` method; use `list(target_versions)` to create a mutable list copy.
GitWildMatchPatternError1 reportGitWildMatchPatternError in black usually arises from an invalid or malformed .gitignore entry that pathspec cannot parse. Address this by carefully reviewing your .gitignore file for any syntax errors like unbalanced quotes, trailing spaces, or unexpected characters within the patterns. Correct or remove the offending line(s) in .gitignore to resolve the error.
Related Dev Tools Packages
Empowering everyone to build reliable and efficient software.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
Next generation frontend tooling. It's fast!
An extremely fast Python package and project manager, written in Rust.
A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
Subscribe to Updates
Get notified when new versions are released