Issue 13356: test_logging warning on 2.7 (original) (raw)

$ ./python -Wd -3 -m test.regrtest -v test_logging == CPython 2.7.2+ (2.7:39573be48b4a, Nov 6 2011, 17:13:44) [GCC 4.6.1] == Linux-3.0.0-12-generic-i686-with-debian-wheezy-sid little-endian == /home/wolf/dev/py/wide-2.7/build/test_python_6508 Testing with flags: sys.flags(debug=0, py3k_warning=1, division_warning=1, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, tabcheck=1, verbose=0, unicode=0, bytes_warning=0) test_logging [...] test_listen_config_10_ok (test.test_logging.ConfigDictTest) ... /home/wolf/dev/py/wide-2.7/Lib/logging/config.py:599: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if name in existing: ok [...]


Ran 43 tests in 2.328s

OK 1 test OK.

Thanks, Florent. This patch was by you in response to issue #8201 - do you have any suggestion as to the best way to resolve this? I tried changing the non-ASCII logger to '\xc3\xb4\xc3\xbc', which decodes cleanly to u'\xf4\xfc' (o-circumflex u-umlaut), but it apparently still fails to convert to Unicode when doing the comparison, and so still raises the warning. Is there any byte-string sequence which won't give the error in this circumstance? Obviously I could convert it to Unicode, but then the test is checking correct operation when you have a non-ASCII (byte-)string name as well as a Unicode name for loggers.