Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 338456

Summary: dev-python/Babel-0.9.5 fails test
Product: Gentoo Linux Reporter: Neil Leathers <neil.leathers>
Component: Current packagesAssignee: Cédric Krier <cedk>
Status: RESOLVED WORKSFORME    
Severity: normal CC: python
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Clear LC_MESSAGES before testing
ebuild to use the patch

Description Neil Leathers 2010-09-23 16:32:20 UTC
As mentioned in the stabilzation bug

FAIL: Doctest: babel.core.Locale.default
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib64/python2.6/doctest.py", line 2153, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for babel.core.Locale.default
  File "/var/tmp/portage/dev-python/Babel-0.9.5/work/Babel-0.9.5/babel/core.py", line 139, in default

----------------------------------------------------------------------
File "/var/tmp/portage/dev-python/Babel-0.9.5/work/Babel-0.9.5/babel/core.py", line 145, in babel.core.Locale.default
Failed example:
    Locale.default('LC_MESSAGES')
Expected:
    <Locale "fr_FR">
Got:
    <Locale "en_CA">

This appears to be due to the following test logic:
        >>> for name in ['LANGUAGE', 'LC_ALL', 'LC_CTYPE']:
        ...     os.environ[name] = ''
        >>> os.environ['LANG'] = 'fr_FR.UTF-8'
        >>> Locale.default('LC_MESSAGES')
        <Locale "fr_FR">

This checks LC_MESSAGES without clearing it. However, on my system:
host ~ # env | grep LC
LC_PAPER=en_CA.UTF-8
LC_MONETARY=en_CA.UTF-8
LC_NUMERIC=en_CA.UTF-8
LC_ALL=en_CA.UTF-8
LC_MESSAGES=en_CA.UTF-8
LC_COLLATE=en_CA.UTF-8
LC_CTYPE=en_CA.UTF-8
LC_TIME=en_CA.UTF-8

So LC_MESSAGES is set to a value.

Reproducible: Always

Steps to Reproduce:
1. emerge -u --oneshot Babel

Actual Results:  
Test Fail

Expected Results:  
Test pass
Comment 1 Neil Leathers 2010-09-26 23:38:33 UTC
I was able to work around the failure as follows:

1. Edit /etc/env.d/02locale to remove the line

LC_MESSAGES="en_CA.UTF-8"

2. env-update
3. emerge Babel

So the bug is probably due to test case setup not correctly clearing LC_MESSAGES.
Comment 2 Neil Leathers 2010-10-15 04:29:23 UTC
Created attachment 250645 [details, diff]
Clear LC_MESSAGES before testing
Comment 3 Neil Leathers 2010-10-15 04:29:53 UTC
Created attachment 250647 [details]
ebuild to use the patch
Comment 4 Neil Leathers 2010-10-15 04:35:41 UTC
Created upstream ticket: http://babel.edgewall.org/ticket/243
Comment 5 Neil Leathers 2011-01-09 15:32:20 UTC
No longer fails testing.