Repository navigation
BUG : nbagg py3k compatibility - #3464
Conversation
Due to scoping fixes in py3k, list comprehensions over class level attributes during class definition does not work (see http://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition). Superficially Fixes matplotlib#3436. There seem to be other issues
|
the backend will now start without error, but I get only a white space under the top bar with the red close button. |
|
cc @pelson |
|
The fix looks good to me. I would probably just have rewritten it as a regular loop but this is perhaps better. No clue about the blank screen |
|
Having the lists as class members seemed a tad too cute to me, as near as I could tell the list attributes never got re-used, and this seemed like the minimal change. |
There was a problem hiding this comment.
How can this work? _font_awesome_classes now appears only here in this file, so as far as I can see, it is undefined. Overall, this block of code looks like a list incomprehension, not a list comprehension.
There was a problem hiding this comment.
indeed, fixed it earlier today, but didn't get the commit pushed up till now.
|
OK, as a minimal change this should be fine. I still agree with Jens that this would be more readable, hence better, as a loop; but that would be just a style tweak. |
When formatting the png data to send over the wire need to decode the byte string to ascii. If this is not done the literal string sent to the browser is: "data:image/png;base64,b'iVBOR...'" instead of "data:image/png;base64,iVBOR..." The extra b' makes the string no longer a valid png which is why we were getting white boxes
|
Thanks @tacaswell! |
Due to scoping fixes in py3k, list comprehensions over class level
attributes during class definition does not work (see
http://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition).
Superficially Fixes #3436. There seem to be other issues