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 767266 - Add missing filename type annotations
Add missing filename type annotations
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Language Bindings
3.21.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 767268
 
 
Reported: 2016-06-05 16:26 UTC by Christoph Reiter (lazka)
Modified: 2018-05-02 17:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add missing filename type annotations (8.73 KB, patch)
2016-06-05 16:26 UTC, Christoph Reiter (lazka)
none Details | Review
Add missing filename type annotations (4.73 KB, patch)
2016-06-07 16:58 UTC, Christoph Reiter (lazka)
none Details | Review

Description Christoph Reiter (lazka) 2016-06-05 16:26:40 UTC
Created attachment 329154 [details] [review]
Add missing filename type annotations

I'm currently working on improving filename handling in PyGObject which depends on filenames being annotated as such. See bug 746564
Comment 1 Matthias Clasen 2016-06-07 13:11:58 UTC
Review of attachment 329154 [details] [review]:

It seems a little dubious to me to apply this to all comamndline arguments
Comment 2 Christoph Reiter (lazka) 2016-06-07 15:36:19 UTC
A filename in glib is bytes on Unix and utf-8 on Windows. I'm not sure what the encoding of commandline args is, I guess depending on the context either data, ascii or filenames?

Imo marking them as filenames is better than what we have now because:

* Both filenames and argv in glib are null terminated bytes on Unix and utf-8 on Windows
* In Python both things get treated the same, so at least in PyGObject this is all the information we need. Not sure about other bindings.
Comment 3 Christoph Reiter (lazka) 2016-06-07 16:58:06 UTC
Created attachment 329315 [details] [review]
Add missing filename type annotations

Now without the argv changes
Comment 4 Christoph Reiter (lazka) 2016-07-11 14:15:45 UTC
Comment on attachment 329154 [details] [review]
Add missing filename type annotations

I've posted to gir-devel-list some weeks ago and got one endorsement and no objections.

https://mail.gnome.org/archives/gir-devel-list/2016-June/msg00000.html

So, I'd like to propose the first patch for inclusion again.
Comment 5 Matthias Clasen 2016-08-11 15:12:33 UTC
(In reply to Christoph Reiter (lazka) from comment #2)
> A filename in glib is bytes on Unix and utf-8 on Windows. I'm not sure what
> the encoding of commandline args is, I guess depending on the context either
> data, ascii or filenames?
> 

How GOption treats encoding is documented in the GLib documentation:

 * If an option is declared to be of type string or filename, GOption takes
 * care of converting it to the right encoding; strings are returned in
 * UTF-8, filenames are returned in the GLib filename encoding. Note that
 * this only works if setlocale() has been called before
 * g_option_context_parse().
Comment 6 Matthias Clasen 2018-02-10 05:21:48 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 7 GNOME Infrastructure Team 2018-05-02 17:12:45 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/633.