-
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
blib2to3 tries to store grammar pickle in global site-packages #192
Comments
The cache shoves off about 18ms startup time on my machine:
|
We should move this cache to the cache dir in appdirs. @ojii, interested? |
I'll try to have a look next week. |
amyreese
added a commit
to amyreese/black
that referenced
this issue
May 17, 2018
Uses `appdirs.user_cache_dir("black") / "blib2to3"`
ambv
pushed a commit
that referenced
this issue
May 18, 2018
tiran
added a commit
to tiran/black
that referenced
this issue
May 19, 2018
blib2to3.pygram assumes that blib2to3's directory is writeable. This is not the case for global installation of black on Linux distributions. Additionally Python 2 grammar no longer contains async and await keywords. Fixes: psf#192 Signed-off-by: Christian Heimes <christian@python.org>
tiran
added a commit
to tiran/black
that referenced
this issue
May 19, 2018
blib2to3.pygram assumes that blib2to3's directory is writeable. This is not the case for global installation of black on Linux distributions. Fixes: psf#192 Signed-off-by: Christian Heimes <christian@python.org>
tiran
added a commit
to tiran/black
that referenced
this issue
May 19, 2018
blib2to3.pygram assumes that blib2to3's directory is writeable. This is not the case for global installation of black on Linux distributions. Fixes: psf#192 Signed-off-by: Christian Heimes <christian@python.org>
zsol
pushed a commit
to zsol/blib2to3
that referenced
this issue
Jun 19, 2019
There is no need to keep the pickled grammar files in git. PR #203 will move them into a user-specific cache directory any way. See: psf/black#192 Signed-off-by: Christian Heimes <christian@python.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
blib2to3
tries to store a version specific pickle of the grammar in the global site-package directory. This works fine for user-owned installations in a virtual env but not for OS vendored installation. Users typically don't have permission to write to system-wide site-packages directory.I tracked down the write through
Grammar.dump
,load_grammar
andload_packaged_grammar
to https://github.com/ambv/black/blob/master/blib2to3/pygram.py. Theload_grammar
takes a pickle file name asgp
argument, butload_packaged_grammar
andpygram
don't use it.Some pickle files are checked into git but not installed by
setup.py
, too.The text was updated successfully, but these errors were encountered: