-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Black fails due to incompatible cache format #875
Comments
I just ran into this. The workaround for now is to remove the cache. Cache locations are described in black's readme and vary by os. See https://github.com/psf/black#ignoring-unmodified-files. |
#1034 adds a test and fixes the issue. I'd be tempted to make a bare except here, so that we simply |
A black cache created in Python 3.8 throws an unhandled ValueError in earlier versions. This is because 3.6 does not recognize the pickle protocol used as default in 3.8. Accordingly, this commit: - Fixes read_cache to return an empty cache instead. - Changes the pickle protocol to 4 as the highest protocol fully supported by black's supported Python versions.
Exact error message to help google:
Invalidating caches:
|
Good tip. Also possibly worth noting, in case of any odd problems, that the exact cache directory being used can be pulled from black's constants:
|
This shouldn't be necessary anymore |
Ran into this today on a just installed black 19.3b0 on Python 3.8.0. |
This is fixed in the latest stable release, 19.10b0. (19.3b0 was released in March.) For many different reasons people can't or don't use the latest versions, so having the removal information seems handy to me. 😄 |
I had just pip installed it without pinning a version. Weird that I got an out of date version. I'll reinstall when I'm on that machine and see if I get the up-to-date version. |
I believe this is all fixed. |
On python3.9, version 18.9b0 currently pinned fails with `AttributeError: type object '_asyncio.Task' has no attribute 'all_tasks'` on python3.9 Also ran into psf/black#875 while fixing this.
* Update black to latest version. On python3.9, version 18.9b0 currently pinned fails with `AttributeError: type object '_asyncio.Task' has no attribute 'all_tasks'` on python3.9 Also ran into psf/black#875 while fixing this. * Update `master` -> `main` for @timothycrosley's test repo. * Cruft update to @timothycrosley's latest template. * Update mypy to remove spurious errors. * Update portray to fix Safety warning on mkdocs-material. * Add python3.9 to Github Actions test matrix.
There is a bug in 19.3b0 which may cause problems locally. psf/black#875
There is a bug in 19.3b0 which may cause problems locally. psf/black#875
* Update Black dev dependency There is a bug in 19.3b0 which may cause problems locally. psf/black#875 * Update CHANGELOG * Update PR number in CHANGELOG * Reformat after updating black.
Currently (19.3b0) Black uses the highest protocol for pickling the cache. In Python 3.8 it is 5. Protocol 5 is not supported on versions < 3.8. As a consequence, after using Black on 3.8 it becomes unusable on older Pythons.
Possible solutions:
These options can be applied together.
The text was updated successfully, but these errors were encountered: