[cairo] pycairo (py3): Surface.create_for_data: Not Implemented yet

Michael Droettboom mdroe at stsci.edu
Fri Nov 18 10:27:53 PST 2011

In the process of porting matplotlib to Python 3, and then its pygtk 
backend to pygobject-introspection, I came across the following issue 
with pycairo on Python 3.

When using the "Surface.create_for_data" method, I get the following:

     NotImplementedError: Surface.create_for_data: Not Implemented yet

This seems to be the way to get an ARGB bitmap image in memory to a 
Gtk.DrawingArea for display, so it's rather important for our needs.  Is 
there an alternative method that maybe I'm missing?

Hoping to be a good open source citizen, I thought I'd see what I could 
do to implement this.  I checked out pycairo from git, and saw that 
there is actually an implementation there -- so I commented out the 
lines where the NotImplementedError is raised, and it *seems* to work 
just fine.  Is there some implementation detail or corner case here that 
isn't working correctly that lead to the disabling of this function?  
I'm happy to try to address any issues and submit a patch, but it 
already seems to be working, as far as I can tell.

Thanks for any pointers you may have,

More information about the cairo mailing list