After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 311139 - pango.Context() creates invalid abstract object
pango.Context() creates invalid abstract object
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: pango
2.5.x/2.6.x
Other All
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
critical-warning
: 317342 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-07-21 12:13 UTC by Torsten Landschoff
Modified: 2008-05-15 19:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Torsten Landschoff 2005-07-21 12:13:50 UTC
Please describe the problem:
Running the following sample script leads to a segmentation fault:

#! /usr/bin/env python
import pango
import gtk.gdk
print "1"
p = gtk.gdk.Pixmap(None,768,512,24)
print "2"
gc = p.new_gc()
print "3"
pl = pango.Layout(pango.Context())
print "4"
pl.set_text("H E L L O")
print "5"
p.draw_layout(gc,10,10,pl)
print "6"


Steps to reproduce:
1. Run above script

Actual results:
torsten@pulsar:~$ python test.py
1
2
3
4
5

(test.py:9824): Pango-CRITICAL **: pango_font_map_load_fontset: assertion
`fontmap != NULL' failed

(test.py:9824): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion
`G_IS_OBJECT (object)' failed

(test.py:9824): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion
`G_IS_OBJECT (object)' failed

(test.py:9824): Pango-CRITICAL **: pango_font_map_get_shape_engine_type:
assertion `PANGO_IS_FONT_MAP (fontmap)' failed

(test.py:9824): GLib-CRITICAL **: g_quark_from_string: assertion `string !=
NULL' failed
Segmentation fault


Expected results:
pango.Context() should throw an exception because pango.Context is abstract.

Does this happen every time?
Yes

Other information:
see http://bugs.debian.org/317105
Comment 1 John Finlay 2005-07-21 14:59:44 UTC
A pango.Context is not an abstract object and is created by Python when using
the constructor but is probably not properly initialized. Several pango types
have this problem as well: Font, FontFace, FontFamily, FontMap, FontMetrics
Comment 2 Gustavo Noronha (kov) 2005-09-27 14:47:08 UTC
*** Bug 317342 has been marked as a duplicate of this bug. ***
Comment 3 Gian Mario Tagliaretti 2008-05-15 19:44:18 UTC
This bug as been fixed already

>>> c = pango.Context()
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
TypeError: pango.Context cannot be instantiated directly
>>> c = pango.Font()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot create instance of abstract (non-instantiable) type `PangoFont'
>>> c = pango.FontMap()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot create instance of abstract (non-instantiable) type `PangoFontMap'
>>> c = pango.FontFamily()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot create instance of abstract (non-instantiable) type `PangoFontFamily'
>>>