Ticket #1 (new defect)

Opened 3 years ago

Last modified 3 years ago

Error in the RadiusDictionaryFile fonction

Reported by: djojo Owned by: somebody
Priority: blocker Milestone:
Component: component1 Version: 2.0
Keywords: Cc:

Description

class RadiusDictionaryFile(object):

def init(self, base_file_name):

self.file_names = [base_file_name] log.warn(base_file_name) self.fd_stack = [open(base_file_name)]

def readlines(self):

i=-1 while i<len(self.fd_stack)-1:

line = self.fd_stack[i].readline() if line:

if line.startswith("$INCLUDE"):

file_name = line.rstrip("\n").split(None, 1)[1] if file_name not in self.file_names:

self.file_names.append(file_name) self.fd_stack.append(open(file_name))

continue

else:

yield line

else:

self.fd_stack.pop() if len(self.fd_stack) == 0:

return

i=i+1

Change History

comment:1 Changed 3 years ago by djojo

the fonction in the ticket is the fontion which work. there is a bug when a $INCLUDE is in the dict file.

Note: See TracTickets for help on using tickets.