New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPython qtconsole (0.12) can't export to html with external png #1164
Comments
I can confirm the problem, and it's truly weird: if I type this: scatter(r_[0,1,2], r_[0,1,2], marker='x') everything seems to work fine. But if instead I do this: figure()
scatter(r_[0,1,2], r_[0,1,2], marker='x') then saving with external PNG produces the error you indicate above. Now, those two calls should be the same from our perspective, so I really don't get what's going on. We'll have to dig in to figure this out, but obviously we can't release 0.12 with broken qt console export. Thanks for the timely report! |
simple reproduce:
I've narrowed it down to image_tag returning unicode, but re.sub not handling that properly. Ensuring that image_tag returns utf8-encoded str solves the issue, and I'm right now just trying to figure out the best way to do it. |
Actually, I just confirmed that this bug exists since 0.11, so I'm bringing the priority down to high. If the bug has been in the wild for 4 months, I don't want to hold the 0.12 release just for it. But still, it is real and serious, so we should definitely try to address it ASAP. With a bit of luck we'll have it fixed before the release, but since that's coming this weekend, it may not quite happen right away. |
Ah, yes: the re library is known to have unicode issues, there's even a proposed new regexp library for python itself partly due to these problems. Thanks for getting onto this one! |
PR #1165 seems to address the issue |
encode image_tag as utf8 in [x]html export Should only affect Python 2 Also removes redundant 'setDefaultButton' in Inline/External dialog, which caused strange display of the two buttons. closes ipython#1164
This error looks a bit like that in issue #1087 but the details are different. I create a qtconsole session with some embedded figures. Export to HTML with inline PNG works fine. Export to XHTML/SVG 'works' (with missing images). Export to HTML with external PNG creates a folder with the PNG files correctly but fails to write the HTML (leaving a zero size .html file) with the following error:
I have an html (with embedded PNG) that constitutes a minimal session reproducing this but I don't know how to attach it to this issue. The (non-graphical) content:
The text was updated successfully, but these errors were encountered: