<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><br></div><div>There is definitively a mistune api change, </div><div>we check dependency in setup.py :</div><div><br></div><div><a href="https://github.com/ipython/ipython/blob/50799e6943174cbd24998c4fb018eff42aac5cfb/setup.py#L257">https://github.com/ipython/ipython/blob/50799e6943174cbd24998c4fb018eff42aac5cfb/setup.py#L257</a></div><div><br></div><div>'mistune>=0.5'</div><div><br></div><div>But we definitively don't check at runtime. </div><div>So the bug should be encounters only by people having installed</div><div>master some time ago and just pulling new versions.</div><div><br></div><div>Normal install should not suffer of this. </div><div><br></div><div>You are right about the 500 though.</div><div><br></div><div>-- </div><div>M</div><div><br></div><div><br></div><div><br><div><div>Le 19 janv. 2015 ŕ 12:26, Zoltán Vörös a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi all,<br><br>I have recently had problems with nbconvert, and I was wondering, <br>whether I do something improper, or the code is really broken. I have <br>pulled the latest from master, and nbconvert fails outright with a <br>simple notebook. (This eventually leads to a 500 server error, whenever <br>I try to download a notebook.)<br><br>Here is my traceback:<br><br>ipython nbconvert test.ipynb<br>Traceback (most recent call last):<br>   File "/usr/local/bin/ipython", line 5, in <module><br>     start_ipython()<br>   File "/usr/local/lib/python2.7/dist-packages/IPython/__init__.py", <br>line 120, in start_ipython<br>     return launch_new_instance(argv=argv, **kwargs)<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", <br>line 573, in launch_instance<br>     app.initialize(argv)<br>   File "<string>", line 2, in initialize<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", <br>line 75, in catch_config_error<br>     return method(app, *args, **kwargs)<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line <br>321, in initialize<br>     super(TerminalIPythonApp, self).initialize(argv)<br>   File "<string>", line 2, in initialize<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", <br>line 75, in catch_config_error<br>     return method(app, *args, **kwargs)<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/core/application.py", <br>line 369, in initialize<br>     self.parse_command_line(argv)<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/terminal/ipapp.py", line <br>316, in parse_command_line<br>     return super(TerminalIPythonApp, self).parse_command_line(argv)<br>   File "<string>", line 2, in parse_command_line<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", <br>line 75, in catch_config_error<br>     return method(app, *args, **kwargs)<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", <br>line 471, in parse_command_line<br>     return self.initialize_subcommand(subc, subargv)<br>   File "<string>", line 2, in initialize_subcommand<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", <br>line 75, in catch_config_error<br>     return method(app, *args, **kwargs)<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/config/application.py", <br>line 402, in initialize_subcommand<br>     subapp = import_item(subapp)<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/utils/importstring.py", <br>line 42, in import_item<br>     module = __import__(package, fromlist=[obj])<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/__init__.py", <br>line 3, in <module><br>     from .exporters import *<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/exporters/__init__.py", <br>line 1, in <module><br>     from .export import *<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/exporters/export.py", <br>line 13, in <module><br>     from .templateexporter import TemplateExporter<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/exporters/templateexporter.py", <br>line 30, in <module><br>     from IPython.nbconvert import filters<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/filters/__init__.py", <br>line 6, in <module><br>     from .markdown import *<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/filters/markdown.py", <br>line 79, in <module><br>     class MathBlockLexer(mistune.BlockLexer):<br>   File <br>"/usr/local/lib/python2.7/dist-packages/IPython/nbconvert/filters/markdown.py", <br>line 80, in MathBlockLexer<br>     default_rules = ['block_math', 'latex_environment'] + <br>mistune.BlockLexer.default_rules<br>AttributeError: type object 'BlockLexer' has no attribute 'default_rules'<br><br><br><br>If, in markdown.py, I remove<br><br>+ mistune.BlockLexer.default_rules on line 80, and<br>+ mistune.InlineLexer.default_rules on line 108, then everything seems <br>to work fine.<br><br>Could it be that the mistune version that I have (0.4) doesn't have the <br>default_rules property, but the version with which ipython was tested on <br>travis has? If so, shouldn't nbconvert bail out when the version <br>requirement is not fulfilled, or shouldn't simply the default_rules <br>property be defined, when the class is inherited in markdown.py? If this <br>is the case, I could file a fix on github.<br><br>Somewhat related: if there is a server error, wouldn't it be more <br>meaningful to return the traceback, instead of "500: internal server error"?<br><br>Cheers,<br>Zoltán<br><br><br>_______________________________________________<br>IPython-dev mailing list<br><a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>http://mail.scipy.org/mailman/listinfo/ipython-dev<br></div></blockquote></div><br></div></body></html>