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 767245 - Add filename type annotations
Add filename type annotations
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-06-04 16:10 UTC by Christoph Reiter (lazka)
Modified: 2016-06-07 18:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glib: Add filename type annotations (35.51 KB, patch)
2016-06-04 16:10 UTC, Christoph Reiter (lazka)
committed Details | Review
gio: Add filename type annotations (22.17 KB, patch)
2016-06-04 16:10 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Christoph Reiter (lazka) 2016-06-04 16:10:07 UTC
In PyGObject we currently only support utf-8 filenames/env vars/process arguments as the arguments are all marked as utf-8.

With Python 2 this hasn't been much of a problem as we only used encoded bytes for everything there, but on Python 3 we strictly use unicode objects (str) for arguments marked as utf-8, so anything not being valid utf-8 leads to runtime errors. For example passing non-utf8 data to argv will prevent any PyGObject app from starting.

See https://bugzilla.gnome.org/show_bug.cgi?id=746564
Comment 1 Christoph Reiter (lazka) 2016-06-04 16:10:34 UTC
Created attachment 329128 [details] [review]
glib: Add filename type annotations

Adds the filename annotation for all file names
and things which can contain file names like
environment variables, argv-

On Unix they can contain anything while on Windows
they are always utf-8.
Comment 2 Christoph Reiter (lazka) 2016-06-04 16:10:54 UTC
Created attachment 329129 [details] [review]
gio: Add filename type annotations
Comment 3 Emmanuele Bassi (:ebassi) 2016-06-04 18:18:07 UTC
Review of attachment 329128 [details] [review]:

Looks good.
Comment 4 Emmanuele Bassi (:ebassi) 2016-06-04 18:19:35 UTC
Review of attachment 329129 [details] [review]:

Okay.
Comment 6 Christoph Reiter (lazka) 2016-06-07 18:03:08 UTC
I've reverted the environment variable / command line arguments related annotation changes as there were some concerns about those.