TestLocale.test_log_BOGUS fails on karmic python2.6

Bug #413514 reported by Martin Pool on 2009-08-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
High
Vincent Ladeuil

Bug Description

This works in python2.5 but fails on 2.6:

^^^^[log from bzrlib.tests.blackbox.test_locale.TestLocale.test_log_BOGUS]----
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mbp/bzr/trunk/bzrlib/tests/blackbox/test_locale.py", line 78, in test_log_BOGUS
    """, err)
AssertionError: texts not equal:
  bzr: warning: unsupported locale setting
    bzr could not set the application locale.
    Although this should be no problem for bzr itself,
    it might cause problems with some plugins.
    To investigate the issue, look at the output
    of the locale(1p) tool available on POSIX systems.
- bzr: warning: unsupported locale setting
- Could not determine what text encoding to use.
- This error usually means your Python interpreter
- doesn't support the locale set by $LANG (BOGUS)
- Continuing with ascii encoding.

----------------------------------------------------------------------
Ran 2 tests in 0.758s

FAILED (failures=1)
tests failed
./bzr selftest TestLocale 6.14s user 0.39s system 87% cpu 7.458 total

Related branches

Martin Pool (mbp) wrote :

Happy to say it passes on wine python2.6.2

Vincent Ladeuil (vila) wrote :

Right that one is failing on karmic/python2.6 in the test farm.

The test itself already has a big XXX just before the assertion.

Funnily it refers to the non-breaking part of the string...

        # XXX: This depends on the exact formatting of a locale.Error
        # as the first part of the string. It may be a little tempermental

Vincent Ladeuil (vila) wrote :

More details:

On jaunty:
LANG=BOGUS python2.6
Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bzrlib.osutils
bzr: warning: unsupported locale setting
  Could not determine what text encoding to use.
  This error usually means your Python interpreter
  doesn't support the locale set by $LANG (BOGUS)
  Continuing with ascii encoding.
>>> bzrlib.osutils.get_user_encoding()
'ascii'
>>>

On karmic:

LANG=BOGUS python2.6
Python 2.6.2+ (release26-maint, Jul 24 2009, 16:18:09)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bzrlib.osutils
>>> bzrlib.osutils.get_user_encoding()
'ANSI_X3.4-1968'
>>>

Basically a change in python26, specific to karmic, makes python roughly behave as bzr regarding user_encoding: default to ascii (ANSI_X3.4-1968 being a funny name for ascii) but it stopped emitting warnings.

Vincent Ladeuil (vila) wrote :

Oops, didn't realize you assigned it to you Martin, I have a fix already...

Changed in bzr:
status: Confirmed → Fix Committed
assignee: Martin Pool (mbp) → Vincent Ladeuil (vila)

2009/8/18 Vincent Ladeuil <email address hidden>:
> Oops, didn't realize you assigned it to you Martin, I have a fix
> already...

That's ok, I hadn't actually done anything yet.

--
Martin <http://launchpad.net/~mbp/>

Vincent Ladeuil (vila) on 2009-08-18
Changed in bzr:
milestone: none → 2.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers