Recommended alternative to get_basename does unnecessary IO
Submitted by Aren Olson
Link to original bug (#606988)
Description
(Note: I use pygio/pygobject, not gio directly, however the gio docs lead me to believe this is probably not pygio-specific, hence my filing it here)
In the gio docs, it states that gio.File.get_basename() returns a bytestring not suitable for display, and that instead the "standard::display-name" info should be queried and used. Unfortunately, querying "standard::display-name" appears to attempt to do some IO and thus this alternative fails for inaccessible or non-existent locations, unlike get_basename() which performs no IO and will work on any location, existing or not. This means that the suggested alternative to get_basename() is not suitable for some uses, such as ours. (we display the file's basename as an alternative to information from the file if the file is inaccessible or missing our normal information) Therefore, either that query needs to be fixed to not do any IO, or we need a new method in the vein of get_parse_name() that will return the basename formatted in utf-8. get_parse_basename(), perhaps.
I am using glib 2.22.3-1 and pygobject 2.20.0-1 under arch linux.
Version: 2.22.x