Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init() #41

Closed
tdhulster opened this issue Mar 8, 2013 · 11 comments
Closed
Labels
crash Problems preventing documents from being rendered

Comments

@tdhulster
Copy link

I installed WeasyPrint and all packages that were listed in the Weasyprint - documentation

I'm using Mac OS X 10.8.2
and Python 2.7
And installed Weasyprint in my virtualenv .

Now when i try :
HTML('http://weasyprint.org/').write_pdf('/tmp/weasyprint-website.pdf')

I get following message in my console :

pydev debugger: starting
Ignored border-radius: 6px at 12:3, unknown property.
Ignored background: linear-gradient(#000, #111) at 59:3, invalid value.
Ignored box-shadow: 0 0 1em #888 at 65:3, unknown property.
Ignored text-shadow: 0 0 0.5em #444 at 77:3, unknown property.
Ignored transition: color 0.25s at 150:3, unknown property.
Ignored box-shadow: 0px 0px 2px #ddd at 167:3, unknown property.
Ignored border-radius: 0.2em at 168:3, unknown property.
Ignored text-shadow: 1px 1px 1px #111 at 171:3, unknown property.
Ignored transition: background 0.7s ease at 251:3, unknown property.
Ignored border-radius: 0.2em at 279:3, unknown property.
Ignored box-shadow: 0 0 2px #b7b7b7 at 280:3, unknown property.
Ignored background: url(img/content_haut.png) no-repeat top left, url(img/bas.png) no-repeat bottom right at 301:3, invalid value.
Ignored border-radius: 0.2em at 305:3, unknown property.
Ignored transition: background-color 0.3s linear at 368:3, unknown property.
Ignored box-shadow: 0 0 5px #D60 at 373:3, unknown property.
Parse error at 7:1, unknown at-rule in stylesheet context: @font-face
Parse error at 12:1, unknown at-rule in stylesheet context: @font-face
Parse error at 17:1, unknown at-rule in stylesheet context: @font-face
Parse error at 22:1, unknown at-rule in stylesheet context: @font-face
Parse error at 26:1, unknown at-rule in stylesheet context: @font-face
Parse error at 31:1, unknown at-rule in stylesheet context: @font-face

(process:49474): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:49474): GLib-CRITICAL **: void g_once_init_leave(volatile void *, gsize): assertion `result != 0' failed

(process:49474): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:49474): GLib-CRITICAL **: void g_once_init_leave(volatile void *, gsize): assertion `result != 0' failed

(process:49474): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:49474): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

I googled the GLib-GObject-CRITICAL but didn't find a solution, does anyone knows how to fix this?

@SimonSapin
Copy link
Member

Hi,

Thanks for reporting this. I can’t reproduce this on Linux, and don’t have a Mac to test. What happens afterwards? Does Python crash? Do you get a traceback? Do you get a PDF file?

In any case, I just pushed a change to master to add a call to gobject.g_type_init(). Can you try the git version and see if it fixes the issue? This should work:

pip install git+git://github.com/Kozea/WeasyPrint.git

@tdhulster
Copy link
Author

I tried the git version out and still get the same error ...
No crash, no traceback no pdf ...

(process:99407): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:99407): GLib-CRITICAL **: void g_once_init_leave(volatile void *, gsize): assertion `result != 0' failed

(process:99407): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:99407): GLib-CRITICAL **: void g_once_init_leave(volatile void *, gsize): assertion `result != 0' failed

(process:99407): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:99407): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

@migrome
Copy link

migrome commented Mar 11, 2013

Hello, Is it the same error or I just installed something wrong?
Windows 7. Python 2.7.
gtk2-runtime-2.24.10-2012-10-10-ash.exe
pygtk-all-in-one-2.24.0.win32-py2.7.msi
CFFI and lxml from http://www.lfd.uci.edu/~gohlke/pythonlibs/

just trying to "from weasyprint import HTML"

File "D:_IDE\eclipse\workspace\test\src\main.py", line 5, in
from weasyprint import HTML
File "D:_IDE\eclipse\workspace\test\src\lib\weasyprint_init_.py", line 304, in
from .css import PARSER, preprocess_stylesheet
File "D:_IDE\eclipse\workspace\test\src\lib\weasyprint\css_init_.py", line 30, in
from . import computed_values
File "D:_IDE\eclipse\workspace\test\src\lib\weasyprint\css\computed_values.py", line 20, in
from .. import text
File "D:_IDE\eclipse\workspace\test\src\lib\weasyprint\text.py", line 182, in
gobject.g_type_init()
File "C:\dev\Python27\lib\site-packages\cffi\api.py", line 385, in getattr
make_accessor(name)
File "C:\dev\Python27\lib\site-packages\cffi\api.py", line 381, in make_accessor
raise AttributeError(name)
AttributeError: g_type_init

@SimonSapin
Copy link
Member

My mistake. @migrome , can you try again with the change I just pushed to master? @tdhulster , if you did not have the same AttributeError @migrome , I suspect you might not be using the git version.

@migrome
Copy link

migrome commented Mar 12, 2013

Works fine, thank you.

@tdhulster
Copy link
Author

I did this :
pip install git+git://github.com/Kozea/WeasyPrint.git

But do I have to do something more to use it or should that work?

@SimonSapin
Copy link
Member

@tdhulster do you still have the error with the latest master now? Sometimes pip does nothing when it thinks everything is already installed. Does the output ends with something like "Installed WeasyPrint"? If not, try pip install --upgrade --no-deps (Just --upgrade would also reinstall all dependencies recursively.)

@SimonSapin
Copy link
Member

@tdhulster, I believe this bug is fixed now. Can you confirm? (Make sure you’re using the latest master, see previous message.)

@SimonSapin
Copy link
Member

Closing for lack of response plus belief that this is fixed.

@barathik
Copy link

I am getting the same error in mac. Was this resolved?

@majidhosseini
Copy link

I am getting the same error on Arch Linux, and I used the last version (42.03).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Problems preventing documents from being rendered
Projects
None yet
Development

No branches or pull requests

5 participants