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 767268 - Add missing filename type annotations
Add missing filename type annotations
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.6.0
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 767266
Blocks:
 
 
Reported: 2016-06-05 16:29 UTC by Christoph Reiter (lazka)
Modified: 2018-11-03 12:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add missing filename type annotations (5.10 KB, patch)
2016-06-05 16:29 UTC, Christoph Reiter (lazka)
none Details | Review
Add missing filename type annotations (4.01 KB, patch)
2016-06-07 17:02 UTC, Christoph Reiter (lazka)
none Details | Review

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

I'm currently working on improving filename handling support in PyGObject which depends on filenames being annotated as such. See bug 746564
Comment 1 Sebastian Dröge (slomo) 2016-06-06 08:11:55 UTC
Review of attachment 329156 [details] [review]:

What is the exact difference between a string and a filename, other than the semantic difference? How is it handled differently, is the string encoding possibly different, ...?

::: gst/gst.c
@@ +318,3 @@
  * @argc: (inout) (allow-none): pointer to application's argc
+ * @argv: (inout) (array length=argc) (element-type filename) (allow-none):
+ *        pointer to application's argv

Why is argv an array of "filenames"? It's arbitrary command line arguments
Comment 2 Christoph Reiter (lazka) 2016-06-06 08:59:15 UTC
(In reply to Sebastian Dröge (slomo) from comment #1)
> Review of attachment 329156 [details] [review] [review]:
> 
> What is the exact difference between a string and a filename, other than the
> semantic difference? How is it handled differently, is the string encoding
> possibly different, ...?

A text string is valid utf-8 while a filename is a null terminated array of bytes on Unix and valid utf-8 on Windows.

> ::: gst/gst.c
> @@ +318,3 @@
>   * @argc: (inout) (allow-none): pointer to application's argc
> + * @argv: (inout) (array length=argc) (element-type filename) (allow-none):
> + *        pointer to application's argv
> 
> Why is argv an array of "filenames"? It's arbitrary command line arguments

It just matches the semantics stated above, null terminated bytes on Unix, valid utf-8 on Windows.
Comment 3 Tim-Philipp Müller 2016-06-06 09:23:28 UTC
Not sure what you're trying to do here, but wouldn't it be better to do this in GOptionParser somewhere?
Comment 4 Christoph Reiter (lazka) 2016-06-06 09:28:52 UTC
My goal is to make "sys.argv = Gst.init(sys.arv)" not crash with Python 3 if argv contains non-utf8 data.
Comment 5 Christoph Reiter (lazka) 2016-06-07 17:02:26 UTC
Created attachment 329316 [details] [review]
Add missing filename type annotations

Now without argv changes.
Comment 6 Sebastian Dröge (slomo) 2016-06-07 17:04:18 UTC
Question is if this generally makes sense or is just something for Python. What is the opinion of the G-I people about this?
Comment 7 Christoph Reiter (lazka) 2016-06-07 17:30:46 UTC
I've just send a message to gir-devel-list to get some advice: https://mail.gnome.org/archives/gir-devel-list/2016-June/msg00000.html
Comment 8 Sebastian Dröge (slomo) 2016-06-08 06:30:03 UTC
Please let us know the result of that discussion :)
Comment 9 Christoph Reiter (lazka) 2016-07-15 09:19:00 UTC
I got one response and no objections. See https://mail.gnome.org/archives/gir-devel-list/2016-June/thread.html#00000

So I'd like to propose the original patch for inclusion.
Comment 10 Tim-Philipp Müller 2016-07-15 11:46:30 UTC
Let's wait for what Gtk+ folks do with this. Still seems dubious to me.
Comment 11 GStreamer system administrator 2018-11-03 12:34:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org'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.freedesktop.org/gstreamer/gstreamer/issues/174.