[cairo] PyCairo crashes
stevech1097 at yahoo.com.au
Tue Nov 17 05:30:05 PST 2009
On Tue, 2009-11-17 at 03:12 -0800, cairo-request at cairographics.org
> On Mon, 16 Nov 2009 16:49:42 +0100, Simon B?chler <sbaechler at me.com>
> > self.basename=self.basename.decode("unicode_escape","ignore")
> > self.basename=self.basename.encode("ascii","ignore")
> > self.surface2.write_to_png(self.basename)
> > Now special characters are just left out which is sad. Apparently
> > function cannot deal with those.
You originally said self.basename was a string, but its now looking like
you are using unicode objects.
> Strange. The underlying C function:
> cairo_surface_write_to_png (cairo_surface_t *surface,
> const char *filename)
> Takes that filename and just calls:
> FILE *fp = fopen (filename, "wb");
> So that should work with pretty much any sequence of bytes you like
> the filename, (as long as it doesn't contain '/' of course).
> So perhaps there's a bug somewhere in the python wrapper for this
Probably. If Simon can state exactly what string or unicode object he is
using which is giving the problems it will make it much easier to find
More information about the cairo