Bug 623852

Summary: gtk-vnc indirectly uses PyCObject API (deprecated in Python 2.7)
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: gtk-vncAssignee: Daniel Berrangé <berrange>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: berrange, mclasen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-08 10:11:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 621887, 623844    
Bug Blocks: 620842    

Description Dave Malcolm 2010-08-13 00:43:20 UTC
Description of problem:
Python 2.7 deprecated the PyCObject API in favor of a new "capsule" API.
  http://docs.python.org/dev/whatsnew/2.7.html#capsules

The deprecations are set to "ignore" by default, so in theory the API still works.

However the deprecation has caused at least one app to fail (virt-manager, see bug 620216, due to it modifying the warning settings), so I've been doublechecking the scope of usage of the PyCObject, and am filing bugs against components that are possibly affected.

You can trigger a hard failure of the API via:
>>> import warnings
>>> warnings.filterwarnings('error')
>>> import gtkvnc
python: /root/rpmbuild/BUILD/Python-2.7/Objects/dictobject.c:759: PyDict_SetItem: Assertion `value' failed.
Aborted

The usage (annoyingly) comes via macro code in header files in pygobject2 and pygtk2 (see bug 623844 and bug 621887).
./src/vncmodule.defs.c:9:#include "pygobject.h"
./src/vncmodule.c:21:#include <pygobject.h>
./src/vnc.override:4:#include "pygobject.h"

I'm not yet sure what the best approach is to fixing this.

Version-Release number of selected component (if applicable):
gtk-vnc-0.4.1-3.fc14.src.rpm

Comment 1 Daniel Berrangé 2010-08-13 02:51:13 UTC
I'm not particularly inclined to change / fix the GTK-VNC python module. With the arrival of GTK-3 the existing python module is being deprecated and all apps should switch to using GObject introspection via PyGObject. In the mean time, simply don't set 'filterwarnings(error)'