Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

diskcache-community forked from DiskCache at upstream commit ebfa37c (3 March 2024), two commits after the 5.6.3 release. Each entry names the pull request in this repository. Imported upstream pull requests are referenced by number, and their commits keep their original authors in the git history.

## Unreleased

### Changes

- `SafeDisk.with_numpy()` keeps the `.npy` headers it has parsed or written, so reading an array no longer parses its header each time. A hit on a 384-value float32 array takes about as long as a pickle with the default `Disk`, where it took about three times as long, and a write is about 30% faster. Each header is still checked against the size of the data, and the stored format is unchanged, so 5.8.2 and 5.8.3 read the new entries and the other way round.
- `SafeDisk.with_numpy()` accepts numpy booleans, integers, floats, complex numbers, strings and bytes in keys, also inside tuples, lists, dicts, sets and frozensets, and stores them as the Python values `item()` gives, so `int64(1)` and `1` name the same entry. They raised `TypeError`.
- `SafeDisk.with_numpy()` accepts arrays in keys, alone or inside tuples and lists, and as `memoize` arguments. Every array in a key is stored in C order, so an equal array of the same dtype and shape names the same entry. A key without numpy keeps the bytes earlier versions wrote.
- `SafeDisk.with_numpy()` stores `datetime64` and `timedelta64` scalars with their unit, arrays of objects element by element (each element checked like any value), record arrays and masked arrays with their type, and memory maps as the plain array of their data. They raised `TypeError`. These entries, and keys holding numpy data, read as unreadable on 5.8.3 and earlier.

### Fixes

- `SafeDisk.with_numpy()` stores each short-lived array a value hands to pickle with its own data. A value whose pickling made temporary views of one array, such as an object whose `__reduce__` yields slices, could be stored with one view's data in place of later ones, which then read back wrong. Affected 5.8.2 and 5.8.3.

## 5.8.3 (2026-11-03)

Fixes a regression from 5.8.2 and several `SafeDisk` issues found by testing downstream libraries, and updates the documentation. The `cache.db` schema and the file layout are unchanged.
Expand Down Expand Up @@ -86,7 +99,7 @@ The package is now imported as `diskcache_community`, so it installs next to the
### Packaging

- **Breaking:** the package is imported as `diskcache_community` instead of `diskcache`, so it installs next to the upstream `diskcache` distribution without overwriting it, and a project can move to the fork while other dependencies still require `diskcache`. The public API, the `cache.db` schema, the file layout and the serialization are unchanged, so cache directories are shared with 5.6.3 in both directions. Django settings name `diskcache_community.DjangoCache` and `diskcache_community.SafeDisk`. The import-time warning about an upstream `diskcache` installed in the same environment is gone, and a CI job installs both distributions together, runs the golden tests in both directions and checks that uninstalling either leaves the other working (PR #22).
- `LICENSE` now holds the full Apache License 2.0 text instead of the short boilerplate notice, so GitHub and package indexes detect the license; the copyright and fork notice stay in `NOTICE` (PR #21).
- `LICENSE` now holds the full Apache License 2.0 text instead of the short boilerplate notice, so GitHub and package indexes detect the license.

## 5.7.0 (2026-10-11)

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

diskcache-community is a community fork of [DiskCache](https://github.com/grantjenks/python-diskcache). Bug reports, fixes and small, focused features are welcome. For anything larger, open an issue first so the approach can be agreed before the work is done.
diskcache-community is a fork of [DiskCache](https://github.com/grantjenks/python-diskcache). Bug reports, fixes and small, focused features are welcome. For anything larger, open an issue first so the approach can be agreed before the work is done.

## Setting up

Expand Down
9 changes: 0 additions & 9 deletions NOTICE

This file was deleted.

21 changes: 3 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@
</p>
<br />

> [!IMPORTANT]
> This is a community fork of [python-diskcache](https://github.com/grantjenks/python-diskcache),
> whose last release was 5.6.3 in August 2023. It is published on PyPI as
> `diskcache-community` and imported as `diskcache_community`, so it installs
> next to the upstream `diskcache` package. It carries the fix path for
> [CVE-2025-69872](https://github.com/advisories/GHSA-w8v5-vhqr-4h9v) and
> reads and writes the same cache directories as 5.6.3.
> See [Why this fork](#why-this-fork), [Migrating from diskcache](#migrating-from-diskcache)
> and [Fix CVE-2025-69872 in diskcache](https://diskcache-community.readthedocs.io/en/latest/fix-cve-2025-69872.html).

## Install

```sh
Expand Down Expand Up @@ -127,8 +117,7 @@ The upstream project stopped releasing after 5.6.3 (August 2023) and its last
commit landed in March 2024. In 2025, CVE-2025-69872 was published against
every released version: the cache reads pickled values with `pickle.load`, so
anyone who can write into the cache directory can run code in the process
that reads from it. The package still works, but scanners flag it and there
is no fixed upstream version.
that reads from it.

This fork publishes the same library as `diskcache-community`. It keeps the
`cache.db` schema, the file layout, the serialization modes and the memoize
Expand All @@ -141,9 +130,6 @@ dependencies in the same environment still use the upstream `diskcache`.
The [changelog](CHANGELOG.md) lists every change and
[SECURITY.md](SECURITY.md) describes what is and is not fixed.

DiskCache was written and maintained by Grant Jenks from 2016 to 2023. This
fork keeps his license, copyright and author credit; see [NOTICE](NOTICE).

## Migrating from diskcache

The public API and the files on disk are unchanged; only the import name
Expand Down Expand Up @@ -222,6 +208,5 @@ how to run the tests. Report vulnerabilities privately as described in

## License

Copyright 2016-2023 Grant Jenks. Modifications in this fork are copyright
2026 diskcache-community contributors. Licensed under the
[Apache License, Version 2.0](LICENSE).
Copyright 2026 August V.
Licensed under the [Apache License, Version 2.0](LICENSE).
4 changes: 2 additions & 2 deletions diskcache_community/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@
__title__ = 'diskcache-community'
__version__ = '5.8.3'
__build__ = 0x050803
__author__ = 'Grant Jenks'
__author__ = 'August V.'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2016-2023 Grant Jenks'
__copyright__ = 'Copyright 2026 August V.'
Loading
Loading