pythongtkgobjectweasyprint

GLib-GObject: g_object_replace_qdata error with Weasyprint


I am trying to print a simple PDF file using Weasyprint following this simple tutorial

I run this command:
python weasyprintdemo.py sample.html sample.pdf

Inside a folder containing the following files:

weasyprintdemo.py
sample.html
sample.css

The output of the command is an infinite loop with the following 2 messages:

(process:7356): GLib-GObject-CRITICAL **: 11:23:32.010: g_object_replace_qdata: assertion 'G_IS_OBJECT (object)' failed
(process:7356): GLib-GObject-CRITICAL **: 11:23:32.010: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed

The expected sample.pdf is not generated.

The content of weasyprintdemo.py, sample.html and sample.css can be found here

I've solved countless problems trying to make this script working but I am stuck on this one for a week now... Any ideas ?

My working environnment :

> weasyprint --info 

System: Windows
Machine: AMD64
Version: 10.0.17134
Release: 10

WeasyPrint version: 54.2
Python version: 3.6.8
Pydyf version: 0.1.2
Pango version: 15003

The GTK is installed in C:\GTK3 and C:\GTK3\bin is at the top of my Path.


Solution

  • It worked when I downgraded Weasyprint and the GTK to older version.

    New working version: