# What changed in unidiff

> 21 changes in unidiff 1 from its official release notes, upgrade guides and advisories: 4 breaking, 9 new APIs and options. Each one cited. Sources checked 2026-10-24. HTML: https://unstale.sh/pypi/unidiff/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## unidiff 1

### Breaking changes

- Parsing raises UnidiffParseError when a target header has no source. (1.0.1) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.1)
- The minimum supported Python version is now 3.9; Python 2 is dropped. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- The path also strips git mnemonic prefixes such as c/ and i/, so paths from git diff --cached resolve to the plain filename. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- Packaging moves to pyproject.toml. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)

### New APIs and options

- Exposes git submodule file mode through is_submodule. (1.0.1) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.1)
- from_filename gains the metadata_only option. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- from_string gains the metadata_only option. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- A property now indicates whether a patched file is a symlink. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- This API locates hunkless or binary entries. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- A py.typed marker is included for typed-package support. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- The package can now be run as a Python module. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- File modes are now available through source_mode. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- File modes are now available through target_mode. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)

### Behavior and default changes

- Input can be passed directly as bytes and is decoded with the given encoding, defaulting to UTF-8. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)

### Tooling

- The code now has PEP 484 type annotations and generics, including typed iteration. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)

### Fixes and other changes

- Parsing handles binary diffs that do not have a target filename. (1.0.1) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.1)
- Parsing handles consecutive added files that share a /dev/null source. (1.0.1) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.1)
- Parsing handles empty context lines, including DOS context lines, when metadata_only is enabled. (1.0.1) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.1)
- The parser now accepts difflib output with empty filenames. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- A trailing-newline error on hunkless git format-patch files is fixed. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
- The quoted-filename parsing fix missing from 0.7.5 is included. (1.0.0) — [release notes](https://github.com/matiasb/python-unidiff/releases/tag/v1.0.0)
