ncssar / radiolog

SAR radio log program
Other
13 stars 3 forks source link

failure to delete team tab 'Team 101 Back Up' #728

Open caver456 opened 4 months ago

caver456 commented 4 months ago

Reported in #727.

102542:deleteTeamTabAction clicked
102542:deleting team tab: teamName=Team 101BackUp  extTeamName=z_Team101BackUp  niceTeamName=Team 101backUp
102542:  teamNameList before deletion:['dummy', 'Team 101', 'Team 102', 'Team 103', 'Team 104', 'Team 101BackUp']
102542:  extTeamNameList before deletion:['spacerLeft', 'z_Team00101', 'z_Team00102', 'z_Team00103', 'z_Team00104', 'z_Team101BackUp', 'spacer1']
102542:  i=5
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 5369, in tabContextMenu
  File "radiolog.py", line 5840, in deleteTeamTab
ValueError: list.remove(x): x not in list
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 3831, in updateTeamTimers
ValueError: 'z_Team101BackUp' is not in list
Uncaught exception
Traceback (most recent call last):
  File "radiolog.py", line 3831, in updateTeamTimers
ValueError: 'z_Team101BackUp' is not in list
...
...

the not-in-list valueerror repeats every second for the rest of the session. This is the code in question. Seems like this error should never happen...?

        if extTeamName in self.extTeamNameList: # pass through if trying to delete a tab that doesn't exist / has already been deleted
            i=self.extTeamNameList.index(extTeamName)
            rprint("  i="+str(i))
            self.extTeamNameList.remove(extTeamName)
caver456 commented 4 months ago

was able to reproduce the issue using the same team name 'team 101 back up', both when that was the first/only tab, and when it was not the first/only tab. Tried a more standard team name with no spaces, and was able to delete that tab with no errors.

Guessing this is due to having a space (actually, two spaces) in the team name. Need to track down exactly why. Space(s) in team names should be allowed, though a bit odd.