GNOME Bugzilla – Bug 767245
Add filename type annotations
Last modified: 2016-06-07 18:03:08 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
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.
Created attachment 329129 [details] [review] gio: Add filename type annotations
Review of attachment 329128 [details] [review]: Looks good.
Review of attachment 329129 [details] [review]: Okay.
Thanks! https://git.gnome.org/browse/glib/commit/?id=41013a01f44e9fc15ffef55eae78af2425bbd5a3 https://git.gnome.org/browse/glib/commit/?id=f8189ddf9869ed8e90f9b640d9545fe4011adb7d
I've reverted the environment variable / command line arguments related annotation changes as there were some concerns about those.