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 751299 - test-suite failure for test_xdg_dirs if ~/.config/user-dirs.dirs
test-suite failure for test_xdg_dirs if ~/.config/user-dirs.dirs
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.16.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-21 21:45 UTC by Michael Biebl
Modified: 2015-07-03 06:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix test regression when xdg-user-dirs is not installed. (1.14 KB, patch)
2015-06-21 22:01 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Michael Biebl 2015-06-21 21:45:17 UTC
Version: 3.16.2

Since commit 9948a67e677c8a351f2de17080d7a671882570f3
I get test-suite failures for pygobject in test_xdg_dirs.

The problem is, that 
d = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_MUSIC)
returns "None".


This is because on our buildds, xdg-user-dirs is not installed and there is no ~/.config/user-dirs.dirs

To reproduce the problem, make sure there is no ~/.config/user-dirs.*, then run python:
>>> from gi.repository import GLib
>>> d = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_MUSIC)
>>> print d
None



Interestingly, d = GLib.get_user_special_dir(GLib.USER_DIRECTORY_DESKTOP) works, even if ~/.config/user-dirs.dirs missing and returns $HOME/Desktop.

So it seems there is a fallback path for the case ~/.config/user-dirs.dirs, but this only works for GLib.USER_DIRECTORY_DESKTOP but not GLib.UserDirectory.DIRECTORY_MUSIC.


I'm not sure, if this is a bug in gobject-introspection, glib itself or pygobject.
Comment 1 Christoph Reiter (lazka) 2015-06-21 22:01:49 UTC
Created attachment 305788 [details] [review]
Fix test regression when xdg-user-dirs is not installed.

GLib.get_user_special_dir is only guaranteed to always return
a path in case GLib.UserDirectory.DIRECTORY_DESKTOP is passed.
This was unintentionally changed to DIRECTORY_MUSIC
in 9948a67e677c8a351f2de1708.
Comment 2 Michael Biebl 2015-06-21 23:16:05 UTC
Assuming this is expected behaviour from GLib, patch lgtm.
Comment 3 Simon Feltman 2015-06-26 02:04:07 UTC
Review of attachment 305788 [details] [review]:

Thanks, feel free to commit stuff like this without review, just add a commit link in bugzilla.
Comment 4 Christoph Reiter (lazka) 2015-07-02 18:48:31 UTC
Thanks. Pushed to

master: https://git.gnome.org/browse/pygobject/commit/?id=1ed8200abefc3e51e4d2083b1372695aaf4163fb
3.16: https://git.gnome.org/browse/pygobject/commit/?h=pygobject-3-16&id=5cfe5b500870cd65386bff91ec12e7f263831f97

(I don't have permissions to close this bug report..)
Comment 5 Simon Feltman 2015-07-03 00:58:57 UTC
(In reply to Christoph Reiter (lazka) from comment #4)
> (I don't have permissions to close this bug report..)

If you didn't already do this:
https://wiki.gnome.org/Bugsquad/ForMaintainers#To_get_permissions_to_edit_bugs
Comment 6 Olav Vitters 2015-07-03 06:32:42 UTC
(In reply to Christoph Reiter (lazka) from comment #4)
> (I don't have permissions to close this bug report..)

Granted.

Note: Any developer should be able to do this (not sure if wiki was updated).
Comment 7 Christoph Reiter (lazka) 2015-07-03 06:57:26 UTC
(In reply to Olav Vitters from comment #6)
> (In reply to Christoph Reiter (lazka) from comment #4)
> > (I don't have permissions to close this bug report..)
> 
> Granted.

Thanks!