Click
Dev ToolsPython composable command line interface toolkit
Release History
8.3.16 fixesClick 8.3.1 is a bug‑fix release that resolves issues with pager handling, Sentinel.UNSET handling, prompt rendering, and type casting without introducing breaking changes.
8.3.0Breaking5 fixes4 featuresClick 8.3.0 introduces improved flag handling, new defaults support for variable‑length arguments, and several bug fixes, with a potential breaking change in how ``default`` values are passed to callbacks.
8.2.26 fixesClick 8.2.2 is a bug‑fix release that resolves several issues with flag option handling, exception typing, Enum defaults, Zsh completion, envvar hints, and a race condition in StreamMixer, without introducing breaking changes.
8.2.14 fixesClick 8.2.1 is a bug‑fix release that resolves flag handling, nested group shell completion, and CLI runner I/O issues without introducing new features or breaking changes.
8.2.0Breaking4 fixes21 featuresClick 8.2.0 introduces numerous new features, deprecates legacy APIs, drops Python 3.7‑3.9 support, and removes several breaking symbols such as `click.HelpOption` and `mix_stderr`.
Common Errors
FileNotFoundError2 reportsFileNotFoundError in click often arises when dealing with file paths used by functions like `click.launch` or file processing within commands, especially if the provided path is incorrect or the file doesn't exist at the specified location. To fix this, carefully validate file paths to ensure they are correctly formatted and point to existing files, handling potential encoding issues using `sys.getfilesystemencoding()` if necessary and catching the exception with `try...except` to provide informative error messages.
GetLastError1 reportThe "GetLastError" error in click, especially OSError 6, often arises from issues with standard streams (stdin, stdout, stderr) becoming invalid, particularly in Windows environments, or when attempting I/O operations on closed handles. To fix this, ensure proper stream initialization and handling (especially when redirecting or closing streams), and consider using `try...except` blocks to catch `OSError` exceptions during I/O and gracefully handle them, potentially by logging or exiting. You may need to explicitly re-open the standard streams if you are manipulating them directly.
EofError1 reportEofError in click often arises when it attempts to read from stdin but receives an unexpected end-of-file signal before the expected input is provided. To fix this, ensure that when you're mocking or piping input to click's `CliRunner`, the input stream includes any required prompts or data fully, or explicitly close stdin if no further input is needed. Also, check for potential issues where your code prematurely closes stdin, interrupting click's input reading process.
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