Fix error: open log file in text mode to avoid doing str conversion and get some bytes result
This commit is contained in:
		
							
								
								
									
										6
									
								
								iwla.py
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								iwla.py
									
									
									
									
									
								
							| @@ -788,7 +788,7 @@ class IWLA(object): | ||||
|         for l in _file: | ||||
|             # print "line " + l | ||||
|  | ||||
|             groups = self.log_re.match(str(l)) | ||||
|             groups = self.log_re.match(l) | ||||
|  | ||||
|             if groups: | ||||
|                 self._newHit(groups.groupdict("")) | ||||
| @@ -828,9 +828,9 @@ class FileIter(object): | ||||
|             raise StopIteration() | ||||
|         filename = self.filenames.pop(0) | ||||
|         if filename.endswith('gz'): | ||||
|             self.cur_file = gzip.open(filename, 'r') | ||||
|             self.cur_file = gzip.open(filename, 'rt') | ||||
|         else: | ||||
|             self.cur_file = open(filename) | ||||
|             self.cur_file = open(filename, 'rt') | ||||
|  | ||||
|     def next(self): | ||||
|         l = self.cur_file.readline() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user