Skip to content

Instantly share code, notes, and snippets.

@antonymilne
Created April 6, 2022 15:15
Show Gist options
  • Save antonymilne/805da60db4d15fe7a41951633d95ca74 to your computer and use it in GitHub Desktop.
Save antonymilne/805da60db4d15fe7a41951633d95ca74 to your computer and use it in GitHub Desktop.
In [3]: hello(["--count", 3])
Your name: asdf
Hello, asdf!
Hello, asdf!
Hello, asdf!
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/site-packages/click/core.py", line 1065, in main
ctx.exit()
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/site-packages/click/core.py", line 687, in exit
raise Exit(code)
click.exceptions.Exit: 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3524, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-4d6f691ae996>", line 1, in <cell line: 1>
hello(["--count", 3])
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/site-packages/click/core.py", line 1083, in main
sys.exit(e.exit_code)
SystemExit: 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1101, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py", line 248, in wrapped
return f(*args, **kwargs)
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py", line 281, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "/Users/antony_milne/miniconda3/envs/spaceflights/lib/python3.8/inspect.py", line 1515, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
AttributeError: 'tuple' object has no attribute 'tb_frame'
---------------------------------------------------------------------------
Exit Traceback (most recent call last)
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/click/core.py in main(self, args, prog_name, complete_var, standalone_mode, windows_expand_args, **extra)
1064 # by its truthiness/falsiness
-> 1065 ctx.exit()
1066 except (EOFError, KeyboardInterrupt):
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/click/core.py in exit(self, code)
686 """Exits the application with a given exit code."""
--> 687 raise Exit(code)
688
Exit: 0
During handling of the above exception, another exception occurred:
SystemExit Traceback (most recent call last)
[... skipping hidden 1 frame]
<ipython-input-3-4d6f691ae996> in <cell line: 1>()
----> 1 hello(["--count", 3])
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/click/core.py in __call__(self, *args, **kwargs)
1129 """Alias for :meth:`main`."""
-> 1130 return self.main(*args, **kwargs)
1131
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/click/core.py in main(self, args, prog_name, complete_var, standalone_mode, windows_expand_args, **extra)
1082 if standalone_mode:
-> 1083 sys.exit(e.exit_code)
1084 else:
SystemExit: 0
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
[... skipping hidden 1 frame]
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
2079 stb = ['An exception has occurred, use %tb to see '
2080 'the full traceback.\n']
-> 2081 stb.extend(self.InteractiveTB.get_exception_only(etype,
2082 value))
2083 else:
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py in get_exception_only(self, etype, value)
752 value : exception value
753 """
--> 754 return ListTB.structured_traceback(self, etype, value)
755
756 def show_exception_only(self, etype, evalue):
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, evalue, etb, tb_offset, context)
627 chained_exceptions_tb_offset = 0
628 out_list = (
--> 629 self.structured_traceback(
630 etype, evalue, (etb, chained_exc_ids),
631 chained_exceptions_tb_offset, context)
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context)
1365 else:
1366 self.tb = tb
-> 1367 return FormattedTB.structured_traceback(
1368 self, etype, value, tb, tb_offset, number_of_lines_of_context)
1369
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, value, tb, tb_offset, number_of_lines_of_context)
1265 if mode in self.verbose_modes:
1266 # Verbose modes need a full traceback
-> 1267 return VerboseTB.structured_traceback(
1268 self, etype, value, tb, tb_offset, number_of_lines_of_context
1269 )
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py in structured_traceback(self, etype, evalue, etb, tb_offset, number_of_lines_of_context)
1122 """Return a nice text document describing the traceback."""
1123
-> 1124 formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context,
1125 tb_offset)
1126
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py in format_exception_as_a_whole(self, etype, evalue, etb, number_of_lines_of_context, tb_offset)
1080
1081
-> 1082 last_unique, recursion_repeat = find_recursion(orig_etype, evalue, records)
1083
1084 frames = self.format_records(records, last_unique, recursion_repeat)
~/miniconda3/envs/spaceflights/lib/python3.8/site-packages/IPython/core/ultratb.py in find_recursion(etype, value, records)
380 # first frame (from in to out) that looks different.
381 if not is_recursion_error(etype, value, records):
--> 382 return len(records), 0
383
384 # Select filename, lineno, func_name to track frames with
TypeError: object of type 'NoneType' has no len()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment