rope icon indicating copy to clipboard operation
rope copied to clipboard

AttributeError: 'NoProject' object has no attribute 'address'

Open evandrocoan opened this issue 7 years ago • 0 comments

I am trying to fix:

  1. https://github.com/python-rope/rope/issues/234 you can even tell rope not to create .ropeproject folder
  2. https://github.com/palantir/python-language-server/issues/230 Maybe we should prevent creating a .ropeproject/config.py

By using get_no_project() instead of creating a Project object. But while doing that, I this error popped some time on my console:

2018-01-29 03:25:46,476 ERROR jsonrpc.manager:_get_responses:122 API Exception: {'type': 'AttributeError', 'args': ("'NoProject' object has no attribute 'address'",), 'message': "'NoProject' object has no attribute 'address'"}
Traceback (most recent call last):
  File "F:\Python\lib\site-packages\jsonrpc\manager.py", line 112, in _get_responses
    result = method(*request.args, **request.kwargs)
  File "D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\dispatcher.py", line 19, in wrapped
    return func(*args, **kwargs)
  File "D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\python_ls.py", line 161, in m_text_document__completion
    return self.completions(textDocument['uri'], position)
  File "D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\python_ls.py", line 92, in completions
    completions = self._hook('pyls_completions', doc_uri, position=position)
  File "D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\python_ls.py", line 48, in _hook
    return hook(config=self.config, workspace=self.workspace, document=doc, **kwargs)
  File "F:\Python\lib\site-packages\pluggy\__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "F:\Python\lib\site-packages\pluggy\__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "F:\Python\lib\site-packages\pluggy\__init__.py", line 182, in __call__
    return outcome.get_result()
  File "F:\Python\lib\site-packages\pluggy\callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File "F:\Python\lib\site-packages\pluggy\callers.py", line 48, in from_call
    result = func()
  File "F:\Python\lib\site-packages\pluggy\__init__.py", line 180, in <lambda>
    outcome = _Result.from_call(lambda: self.oldcall(hook, hook_impls, kwargs))
  File "F:\Python\lib\site-packages\pluggy\__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "F:\Python\lib\site-packages\pluggy\callers.py", line 201, in _multicall
    return outcome.get_result()
  File "F:\Python\lib\site-packages\pluggy\callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File "F:\Python\lib\site-packages\pluggy\callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\plugins\rope_completion.py", line 31, in pyls_completions
    offset, document._rope, maxfixes=3)
  File "D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\workspace.py", line 185, in _rope
    return libutils.path_to_resource(self._rope_project, self.path)
  File "d:\user\dropbox\softwareversioning\python-rope\rope\base\libutils.py", line 22, in path_to_resource
    project_path = path_relative_to_project_root(project, path)
  File "d:\user\dropbox\softwareversioning\python-rope\rope\base\libutils.py", line 36, in path_relative_to_project_root
    return relative(project.address, path)
AttributeError: 'NoProject' object has no attribute 'address'

evandrocoan avatar Jan 29 '18 05:01 evandrocoan