On a platform running Gtk2 and Python2, giofile is __gi__.GDaemonFile. On a platform running Gtk3 and Python3 it is __gi__.GDummyFile. The latter does not support any subsequent operations (e.g., read). Presumably it indicates that something went wrong with the new_for_uri. The glib networking packages on the platform where the command does not work are version 2.72. On the other platform they are version 2.48. I suspect that some package is missing on the platform where the command fails, but I cannot figure out what it might be. Any suggestions appreciated.