| 1162 | return [[head] + frames + [''.join(formatted_exception[0])]] |
| 1163 | |
| 1164 | def get_records(self, etb, number_of_lines_of_context, tb_offset): |
| 1165 | try: |
| 1166 | # Try the default getinnerframes and Alex's: Alex's fixes some |
| 1167 | # problems, but it generates empty tracebacks for console errors |
| 1168 | # (5 blanks lines) where none should be returned. |
| 1169 | return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset) |
| 1170 | except UnicodeDecodeError: |
| 1171 | # This can occur if a file's encoding magic comment is wrong. |
| 1172 | # I can't see a way to recover without duplicating a bunch of code |
| 1173 | # from the stdlib traceback module. --TK |
| 1174 | error('\nUnicodeDecodeError while processing traceback.\n') |
| 1175 | return None |
| 1176 | except: |
| 1177 | # FIXME: I've been getting many crash reports from python 2.3 |
| 1178 | # users, traceable to inspect.py. If I can find a small test-case |
| 1179 | # to reproduce this, I should either write a better workaround or |
| 1180 | # file a bug report against inspect (if that's the real problem). |
| 1181 | # So far, I haven't been able to find an isolated example to |
| 1182 | # reproduce the problem. |
| 1183 | inspect_error() |
| 1184 | traceback.print_exc(file=self.ostream) |
| 1185 | info('\nUnfortunately, your original traceback can not be constructed.\n') |
| 1186 | return None |
| 1187 | |
| 1188 | def structured_traceback(self, etype, evalue, etb, tb_offset=None, |
| 1189 | number_of_lines_of_context=5): |