Bug 89161

Summary: Error returns from Cairo library are not correctly signalled in python3-cairo
Product: pycairo Reporter: Lawrence D'Oliveiro <from-freedesktop>
Component: generalAssignee: Steve Chaplin <d74n5pohf9>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: set CairoError to an exception that can be raised

Description Lawrence D'Oliveiro 2015-02-16 03:12:39 UTC
Created attachment 113515 [details]
set CairoError to an exception that can be raised

There is a global variable called “CairoError” in python3-cairo, that is passed to PyErr_SetString to raise exceptions for errors returned from the underlying Cairo library. Unfortunately, this is always NULL, which seems to cause the PyErr_SetString calls to be no-ops. This can manifest itself as errors reported from Python to the effect of “null result without error return”.

It turns out an Exception object is created at module initialization time, but never assigned to this variable. This patch fixes the problem.
Comment 1 Christoph Reiter 2017-07-05 15:07:39 UTC
Fixed since 1.11

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.