-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Pylint prints error about cache files in fresh environment with pylint 2.10.2 #4900
Comments
Seeing this as well - this has broken our CI. |
I wonder if we should try to create a cache in the local directory if we can't access the |
I don't know how things have been implemented under the hood, but I would assume that write access is not the issue, you just need to verify that the cache folder exists and create it and all it's parents if it doesn't exist before trying to write anything to there. I believe that the "Unable to create directory" message comes as it tries to create only the Cache folder, but not it's parents, which are also missing. It also seems that the cache files are properly written to Cache folder if .pylint.d folder exists. So somewhere the code is cabable of being able to create the Cache folder and all it's parent's properly. Anyway I'm totally fine with local cache dir also, if the normal cache dir permissions doesn't allow accessing it. |
Based on a @GeZZu's comment and my own testing I assumed changing the function to See DanielNoord#13 for a version with that change. |
Thanks. |
Good to hear! Going to make a PR! |
By changing the function used to create the cache from ``os.mkdir`` to ``os.makedirs`` we now handle non-existing parent directories correctly. This closes pylint-dev#4900
By changing the function used to create the cache from ``os.mkdir`` to ``os.makedirs`` we now handle non-existing parent directories correctly. This closes #4900
Bug description
When I run pylint for my code in fresh environment (in build server), pylint tells me that it's not able to create cache directory (and files) to
%localappdata%\pylint\pylint\Cache (Unable to create directory [full path]
).Nevertheless I get the expected linting results written to a file.
I was able to reproduce the issue in my environment by upgrading pylint to 2.10.2 and removing pylint folder from
%localappdata% and .pylint.d folder from %userprofile%
If I have .pylint.d folder in
%userprofile%
, I'll get message, which tells that .pylint.d is obsolete andPYLINTHOME
now points to%localappdata%\pylint\pylint\Cache
. In that case the cache files are stored properly toPYLINTHOME
.Everything also works in the fresh environment if I create the cache folder
%localappdata%
before running pylint.Command used
Pylint output
Expected behavior
No error messages
Pylint version
OS / Environment
Windows 10
The text was updated successfully, but these errors were encountered: