You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
""" Wrapper around appdir from PyPIWe do not assume to be installed and fallback to an inline copy and if thatis not installed, we use our own code for best effort."""from __future__ importabsolute_importimportosimporttempfilefrom .FileOperationsimportmakePathfrom .ImportingimportimportFromInlineCopytry:
importappdirs# pylint: disable=I0021,import-errorexceptImportError:
# We handle the case without inline copy too.appdirs=importFromInlineCopy("appdirs", must_exist=False)
_cache_dir=NonedefgetCacheDir():
global_cache_dir# singleton, pylint: disable=global-statementif_cache_dirisNone:
_cache_dir=os.getenv("NUITKA_CACHE_DIR")
if_cache_dir:
_cache_dir=os.path.expanduser(_cache_dir)
elifappdirsisnotNone:
_cache_dir=appdirs.user_cache_dir("Nuitka", None)
else:
_cache_dir=os.path.join(os.path.expanduser("~"), ".cache", "Nuitka")
# For people that build with HOME set this, e.g. Debian.if_cache_dir.startswith(("/nonexistent/", "/sbuild-nonexistent/")):
_cache_dir=os.path.join(tempfile.gettempdir(), "Nuitka")
makePath(_cache_dir)
return_cache_dir
pylint crashed with a AstroidError and with the following stacktrace:
Traceback (most recent call last):
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/modutils.py", line 590, in _spec_from_modpath
found_spec = spec.find_spec(modpath, [context])
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/interpreter/_import/spec.py", line 392, in find_spec
finder, spec = _find_spec_with_path(
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/interpreter/_import/spec.py", line 361, in _find_spec_with_path
raise ImportError(f"No module named {'.'.join(module_parts)}")
ImportError: No module named __future__.absolute_import
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/hayen/.local/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 782, in _lint_file
check_astroid_module(module)
File "/home/hayen/.local/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 1049, in check_astroid_module
retval = self._check_astroid_module(
File "/home/hayen/.local/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 1099, in _check_astroid_module
walker.walk(node)
File "/home/hayen/.local/lib/python3.9/site-packages/pylint/utils/ast_walker.py", line 93, in walk
self.walk(child)
File "/home/hayen/.local/lib/python3.9/site-packages/pylint/utils/ast_walker.py", line 90, in walk
callback(astroid)
File "/home/hayen/.local/lib/python3.9/site-packages/pylint/checkers/imports.py", line 523, in visit_importfrom
self._add_imported_module(node, f"{imported_module.name}.{name}")
File "/home/hayen/.local/lib/python3.9/site-packages/pylint/checkers/imports.py", line 833, in _add_imported_module
importedmodname = astroid.modutils.get_module_part(
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/modutils.py", line 438, in get_module_part
file_from_modpath(
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/modutils.py", line 334, in file_from_modpath
return file_info_from_modpath(modpath, path, context_file).location
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/modutils.py", line 384, in file_info_from_modpath
return _spec_from_modpath(modpath, path, context)
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/modutils.py", line 593, in _spec_from_modpath
found_spec = spec.find_spec(modpath, path)
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/interpreter/_import/spec.py", line 392, in find_spec
finder, spec = _find_spec_with_path(
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/interpreter/_import/spec.py", line 354, in _find_spec_with_path
spec = finder_instance.find_module(
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/interpreter/_import/spec.py", line 203, in find_module
if util.is_namespace(modname) and modname in sys.modules:
File "/home/hayen/.local/lib/python3.9/site-packages/astroid/interpreter/_import/util.py", line 42, in is_namespace
found_spec = _find_spec_from_path(
File "/usr/lib/python3.9/importlib/util.py", line 58, in _find_spec_from_path
return _find_spec(name, path)
File "<frozen importlib._bootstrap>", line 925, in _find_spec
File "<frozen importlib._bootstrap_external>", line 1358, in find_spec
File "<frozen importlib._bootstrap_external>", line 1150, in __init__
File "<frozen importlib._bootstrap_external>", line 1165, in _get_parent_path
AttributeError: module '__future__' has no attribute '__path__'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/hayen/.local/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 747, in _lint_files
self._lint_file(fileitem, module, check_astroid_module)
File "/home/hayen/.local/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 784, in _lint_file
raise astroid.AstroidError from e
astroid.exceptions.AstroidError
.
************* Module nuitka.utils.AppDirs
nuitka/utils/AppDirs.py:1 F0002 astroid-error nuitka/utils/AppDirs.py: Fatal error while checking 'nuitka/utils/AppDirs.py'. Please open an issue in our bug tracker so we address this.
Configuration
Configuration usage is explicitely avoided, see command line below.
### Pylint output
```shell
nuitka/utils/AppDirs.py:1 F0002 astroid-error nuitka/utils/AppDirs.py: Fatal error while checking 'nuitka/utils/AppDirs.py'. Please open an issue in our bug tracker so we address this.
Bug description
When parsing the following file:
pylint crashed with a
AstroidError
and with the following stacktrace:.
************* Module nuitka.utils.AppDirs
nuitka/utils/AppDirs.py:1 F0002 astroid-error nuitka/utils/AppDirs.py: Fatal error while checking 'nuitka/utils/AppDirs.py'. Please open an issue in our bug tracker so we address this.
Configuration
Command used
Expected behavior
Not crash
Pylint version
OS / Environment
Debian Buster Python with PyPI packages
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: