sublime_tortoise icon indicating copy to clipboard operation
sublime_tortoise copied to clipboard

local variable 'status' referenced before assignment

Open Mathieson opened this issue 13 years ago • 2 comments

I am receiving this error (the subject line) when right clicking in the side bar. The console is also spitting out the following:

Traceback (most recent call last): File ".\sublime_plugin.py", line 280, in is_visible_ File ".\Tortoise.py", line 71, in handler File ".\Tortoise.py", line 264, in is_visible File ".\Tortoise.py", line 426, in get_status File ".\Tortoise.py", line 353, in process_status UnboundLocalError: local variable 'status' referenced before assignment error: [Error 2] The system cannot find the file specified

It appears that on line 345 in Tortoise.py there is a try/except and the try is declaring a status variable. Something in here is failing within vcs.check_status and the status is not getting declared in the except. There are more references to the status variable later, but when going through the except status does not exist. This is causing the error. Not sure what is causing vcs.check_status to fail, however.

Mathieson avatar Jul 14 '12 00:07 Mathieson

I am experiencing the same problem too:

Traceback (most recent call last):
  File ".\sublime_plugin.py", line 280, in is_visible_
  File ".\Tortoise.py", line 71, in handler
  File ".\Tortoise.py", line 228, in is_visible
  File ".\Tortoise.py", line 446, in get_status
  File ".\Tortoise.py", line 353, in process_status
UnboundLocalError: local variable 'status' referenced before assignment
error: [Error 2] The system cannot find the file specified

I have uninstalled until this is corrected.

atwright147 avatar Sep 16 '12 10:09 atwright147

I have fixed my local copy by adding a placeholder status variable at line 336

def process_status(self, vcs, path):
    global file_status_cache
    status = '';

LiaoHongzheng avatar Oct 25 '12 10:10 LiaoHongzheng