GNOME Bugzilla – Bug 691355
Tests may fail if G_FILENAME_ENCODING is not set to UTF-8
Last modified: 2013-01-09 09:40:58 UTC
Running make check gives me the following output: ERROR: test_filename_out (test_gi.TestFilename) ---------------------------------------------------------------------- Traceback (most recent call last):
+ Trace 231355
dirname = GLib.Dir.make_tmp('testäø.XXXXXX')
return info.invoke(*args, **kwargs)
The test may fail depending on the value of G_ILENAME_ENCODING.
Created attachment 233000 [details] [review] Patch.
Can you confirm that this actually works for you? When I run G_FILENAME_ENCODING=latin1 TEST_NAMES=test_gi.TestFilename make check I still get failures; it seems $G_FILENAME_ENCODING is only evaluated at program start/glib initialization, and you cannot change it at runtime? It does work if I set os.environ['G_FILENAME_ENCODING'] = 'UTF-8' or try: del os.environ['G_FILENAME_ENCODING'] except KeyError: pass in tests/runtests.py (as you originally proposed on IRC yesterday). Can you confirm this? If so, let's just delete the variable in runtests.py then. Thanks!
I had only tried running make check, which was working with the patch that I posted, but, if I set G_FILENAME_ENCODING to latin-1 and only run the filename tests, then I get an error. Setting G_FILENAME_ENCODING to UTF-8 in runtests.py works for me; if I delete the key instead (or unset it before running make check), then I still get the error. Alternatively, deleting both G_UTF8_ENCODING and G_BROKEN_FILENAMES allows make check to pass (although I have no idea what locale glib is trying on my system; running locale returns "en_US.UTF-8").
Thanks for testing again! So it sounds most robust to just explicitly set it to UTF-8: http://git.gnome.org/browse/pygobject/commit/?id=c0bd060521cc1b481995648dbe286b7e2f9ecd80