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 737332 - g_win32_get_command_line() break PyGObject
g_win32_get_command_line() break PyGObject
Status: RESOLVED DUPLICATE of bug 734095
Product: glib
Classification: Platform
Component: win32
2.42.x
Other Windows
: Normal blocker
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-25 04:18 UTC by Bakhtiar Hasmanan
Modified: 2014-10-23 05:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bakhtiar Hasmanan 2014-09-25 04:18:45 UTC
in gio\gapplication.c at g_application_run() changes has been made in 2.39.4 (till latest version) to use g_win32_get_command_line() to retrieve arguments.

In PyGObject this cause application refuse to start by throwing obscure message:
GLib-GIO-CRITICAL **: This application can not open files.

This affecting everything that use application class.

Reverting those changes allow gtk-demo.py to run normally again.
Comment 1 Bakhtiar Hasmanan 2014-09-25 04:37:25 UTC
By the way we at mypaint also use CommandLineToArgvW in main.py to overcome unicode arguments issue. 

In case it's wrong to fix Glib how this supposedly works in python under Windows?
Comment 2 Fan, Chun-wei 2014-10-23 05:45:23 UTC
Hi Bakhtiar,

I think the issue has to do with something like how we are dealing with argv and the command retrieved by CommandLineToArgvW().  So, in CommandLineToArgvW() we get everything that is used to invoke the script (including in this case, python xxx.py, for example), and g_application_run() wouldn't be able to cope with "python", as it is not by itself ready to deal with by GApplication, AFAICT.  I have a proposed fix for this, in bug 734095, so probably I think it is best we we continue to look there for this issue.

With blessings, thank you!

*** This bug has been marked as a duplicate of bug 734095 ***