Hello everyone,
I've been writing a sage module in which I've written some documentation examples and tests. I wanted to run a doctest just to verify if everything is correct but function "run_doctests" seems to introduce a non-expected bug in the software. Here's an exampe:
sage: run_doctests("module.sage")
too few successful tests, not using stored timings
Running doctests with ID 2021-03-10-10-13-36-df8ccbc8.
Using --optional=sage
Doctesting 1 file.
sage -t /path-to-module.sage
[40 tests, 0.07 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 0.1 seconds
cpu time: 0.1 seconds
cumulative wall time: 0.1 seconds
sage: M = ModularForms()
sage: M
Modular Forms space of dimension 0 for Modular Group SL(2,Z) of weight 2 over Rational Field
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/usr/lib/python3/dist-packages/sage/all_cmdline.py in <module>
----> 1 M
/usr/lib/python3/dist-packages/IPython/core/displayhook.py in __call__(self, result)
260 self.start_displayhook()
261 self.write_output_prompt()
--> 262 format_dict, md_dict = self.compute_format_data(result)
263 self.update_user_ns(result)
264 self.fill_exec_result(result)
/usr/lib/python3/dist-packages/IPython/core/displayhook.py in compute_format_data(self, result)
149
150 """
--> 151 return self.shell.display_formatter.format(result)
152
153 # This can be set to True by the write_output_prompt method in a subclass
/usr/lib/python3/dist-packages/sage/repl/display/formatter.py in format(self, obj, include, exclude)
198 """
199 # First, use Sage rich output if there is any
--> 200 sage_format, sage_metadata = self.dm.displayhook(obj)
201 assert PLAIN_TEXT in sage_format, 'plain text is always present'
202 if not set(sage_format.keys()).issubset(self.default_mime()):
TypeError: cannot unpack non-iterable NoneType object
Here's more info about the error: it happens whenever I use the run_doctests function. Then, if I define any object from any class (in my example ModularForms) then when using the _call_ method of that object I obtain this error message. I don't think this have anything to do with the ModularForms class.
Do anybody else know what could introduce this error? I was wondering if this error comes from my module or from Sagemath. In my module, I've been following the general conventions of the developper guide.
I've tried both SageMath verion 9.0 (from the debian SID package) and SageMath version 9.3.beta8 (compiled from source) and I've got the same error with both versions. If this error comes from the software, I shall open a sage-trac ticket about this issue.
Thank you very much in advance!