Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 338456 - dev-python/Babel-0.9.5 fails test
Summary: dev-python/Babel-0.9.5 fails test
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Cédric Krier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-23 16:32 UTC by Neil Leathers
Modified: 2011-01-09 15:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Clear LC_MESSAGES before testing (Babel-0.9.5-LC_MESSAGES_test_failures.patch,979 bytes, patch)
2010-10-15 04:29 UTC, Neil Leathers
Details | Diff
ebuild to use the patch (Babel-0.9.5.ebuild,1020 bytes, text/plain)
2010-10-15 04:29 UTC, Neil Leathers
Details

Note You need to log in before you can comment on or make changes to this bug.
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.