python-rope / ropevim

vim mode that uses rope library to provide features like python refactorings and code-assists
GNU General Public License v2.0
245 stars 34 forks source link

TypeError: _position_to_offset() argument after * must be a sequence, not NoneType #44

Closed mcepl closed 9 years ago

mcepl commented 9 years ago
[Quickfix List] :flake8 "email2BZreport.py"                    1,1             Top
Flake8 found issues
Error detected while processing function RopeExtractVariable:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/decorators.py", line 5
3, in newfunc
    return func(*args, **kwds)
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/interface.py", line 52
, in do_refactor
    refactoring(self, self.env).show(initial_asking=initial_asking)
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/refactor.py", line 32,
 in show
    self._create_refactoring()
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/refactor.py", line 290
, in _create_refactoring
    start, end = self.region
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/refactor.py", line 70,
 in region
    return self.env.get_region()
  File "/home/matej/archiv/knihovna/repos/ropevim/ropevim.py", line 112, in get_re
gion
    start = self._position_to_offset(*self.buffer.mark('<'))
TypeError: _position_to_offset() argument after * must be a sequence, not NoneType

Press ENTER or type command to continue

Happened while parsing https://gist.github.com/mcepl/760e9640dfd2a44499f8

aligrudi commented 9 years ago

Matěj Cepl notifications@github.com wrote:

[Quickfix List] :flake8 "email2BZreport.py"                    1,1             Top
Flake8 found issues
Error detected while processing function RopeExtractVariable:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/decorators.py", line 5
3, in newfunc
    return func(*args, **kwds)
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/interface.py", line 52
, in do_refactor
    refactoring(self, self.env).show(initial_asking=initial_asking)
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/refactor.py", line 32,
 in show
    self._create_refactoring()
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/refactor.py", line 290
, in _create_refactoring
    start, end = self.region
  File "/home/matej/archiv/knihovna/repos/ropemode/ropemode/refactor.py", line 70,
 in region
    return self.env.get_region()
  File "/home/matej/archiv/knihovna/repos/ropevim/ropevim.py", line 112, in get_re
gion
    start = self._position_to_offset(*self.buffer.mark('<'))
TypeError: _position_to_offset() argument after * must be a sequence, not NoneType

I guess the command was performed without specifying a region. Maybe get_region() should be modified to issue an exception with a more readable description, when self.buffer.mark('<') is None.

Ali