+ nosetests ............................F....... ====================================================================== FAIL: test_get_type (test-mime.MimeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/pyxdg-0.25/test/test-mime.py", line 40, in test_get_type self.check_mimetype(imgpng, 'image', 'png') File "/builddir/build/BUILD/pyxdg-0.25/test/test-mime.py", line 11, in check_mimetype self.assertEqual(mimetype.subtype, subtype) AssertionError: 'x-apple-ios-png' != 'png' ---------------------------------------------------------------------- This is with Python 2.7 on Fedora 19. I can only assume that some sort of globbing is generating "x-apple-ios-png" as a result for that comparison. /usr/share/mime/image/x-apple-ios-png.xml exists, as part of shared-mime-info-1.1-4.fc19.
About the only reference to this I can find is a commit message from Horde: '...ridiculous MIME types like "image/x-apple-ios-png" that overwrite the correct MIME types'. Looking at the spec, it seems to be ambiguous what the correct type is in a case like that, at least when the file isn't available to sniff the contents, which is what this test is for. Except of course we know that image/png is the answer we want. I'll ask on the mailing list to get a clearer idea about this.
This change should fix that case, although I'm planning a proper rework of xdg.Mime: https://github.com/takluyver/pyxdg/commit/f87e662ed27edf88152dd6980120b2cf64890db9 (I'll transfer it to the official PyXDG repository this evening)
Patch works, thanks!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.