GNOME Bugzilla – Bug 664415
Gio: file.copy does not allow null for progress_callback parameter
Last modified: 2015-02-07 16:49:25 UTC
Try this e.g. in looking glass: f = Gio.file_new_for_path("some_existing_file") g = Gio.file_new_for_path("nonexistent_file") f.copy(g, 0, null, null, null) This gives: Error: Error invoking Gio.copy: Invalid callback given for argument progress_callback I've verified that this is a problem with gjs and not gio by trying the equivalent C program -- it works. Workaround is to use f.copy(g, 0, null, function () {}, null)
This used to work in whichever gjs came with Fedora 15 -- it's now broken in Fedora 16.
(In reply to comment #1) > This used to work in whichever gjs came with Fedora 15 -- it's now broken in > Fedora 16. Funny. If so, we had a bug in the previous version In fact, looking at glib code, progress_callback is not annotated (allow-none), therefore gjs does not allow null. If NULL is a valid value in C, then the bug is in glib. Reassigning.
In that case, there's also a bug in the Gio docs: http://developer.gnome.org/gio/2.30/GFile.html#g-file-copy "If progress_callback is not NULL, then the operation can be monitored by setting this to a GFileProgressCallback function. " Implies that it may be NULL.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]