pypi / unidiff
unidiff
What changed in unidiff 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-24.
4 breaking9 new APIs and options1 behavior and defaults1 tooling6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initunidiff 121 changes
Breaking changes 4
Parsing raises UnidiffParseError when a target header has no source.
The minimum supported Python version is now 3.9; Python 2 is dropped.
The path also strips git mnemonic prefixes such as c/ and i/, so paths from git diff --cached resolve to the plain filename.
Packaging moves to pyproject.toml.
New APIs and options 9
Exposes git submodule file mode through is_submodule.
from_filename gains the metadata_only option.
from_string gains the metadata_only option.
A property now indicates whether a patched file is a symlink.
This API locates hunkless or binary entries.
A py.typed marker is included for typed-package support.
The package can now be run as a Python module.
File modes are now available through source_mode.
File modes are now available through target_mode.
Behavior and default changes 1
Input can be passed directly as bytes and is decoded with the given encoding, defaulting to UTF-8.
Tooling 1
The code now has PEP 484 type annotations and generics, including typed iteration.
Fixes and other changes 6
Parsing handles binary diffs that do not have a target filename.
Parsing handles consecutive added files that share a /dev/null source.
Parsing handles empty context lines, including DOS context lines, when metadata_only is enabled.
The parser now accepts difflib output with empty filenames.
A trailing-newline error on hunkless git format-patch files is fixed.
The quoted-filename parsing fix missing from 0.7.5 is included.