UnknownLocaleError: unknown locale 'en'

Bug #1299442 reported by Tristan Hill
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
python-babel (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Fix Released
Undecided
Michael Bienia

Bug Description

On two machines I've upgraded (one from precise another from saucy) the file /usr/share/python-babel-localedata/localedata/en.dat has somehow been deleted. Reinstalling the package resolves the problem.

  File "/usr/lib/python2.7/dist-packages/babel/messages/catalog.py", line 337, in _get_mime_headers
    locale='en')))
  File "/usr/lib/python2.7/dist-packages/babel/dates.py", line 609, in format_datetime
    locale = Locale.parse(locale)
  File "/usr/lib/python2.7/dist-packages/babel/core.py", line 313, in parse
    raise UnknownLocaleError(input_id)
UnknownLocaleError: unknown locale 'en'

Version: 1.3+dfsg.1-2ubuntu1

> dpkg -L python-babel-localedata | grep en.dat
/usr/share/python-babel-localedata/localedata/en.dat
> file /usr/share/python-babel-localedata/localedata/en.dat
/usr/share/python-babel-localedata/localedata/en.dat: ERROR: cannot open `/usr/share/python-babel-localedata/localedata/en.dat' (No such file or directory)

[Impact]

The python-babel package got split into python-babel and python-babel-localedata. There were some upgrade issues which got fixed in 1.3+dfsg.1-2 and 1.3+dfsg.1-2.1. Ubuntu merged the package between those versions and missed the second fix. This SRU backports the changes from 1.3+dfsg.1-3 to the package scripts for python-babel.

[Test case]

- Install the python-babel package from either saucy or precise
- Run "pybabel --list-locales" and get a list of locales
- Upgrade python-babel to the version in trusty (will pull in python-babel-localedata)
- Run "pybabel --list-locales" again and get the above error
- Upgrade to the fixed version
- Run "pybabel --list-locales" again and get a list of locales again

- Purge python-babel and python-babel-localedata (to start from fresh to test an upgrade directly to the fixed version)
- Install the python-babel package from either saucy or precise again
- Run "pybabel --list-locales" and get a list of locales
- Upgrade directly to the fixed version
- Run "pybabel --list-locales" and get a list of locales

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-babel (Ubuntu):
status: New → Confirmed
Revision history for this message
Simon Eisenmann (longsleep) wrote :

I had this issue after upgrading from 13.10 to 14.04.

Fix:
$ sudo apt-get install --reinstall python-babel-localedata

Revision history for this message
Michael Bienia (geser) wrote :
description: updated
Revision history for this message
Michael Bienia (geser) wrote :

The fix for Ubuntu 14.10 is in bug #1320612 (merge of 1.3+dfsg.1-3).

James Page (james-page)
Changed in python-babel (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
James Page (james-page) wrote :

Hi Michael

Please could you update the version on the maintainer scripts to align to the SRU version (1.3+dfsg.1-2ubuntu2~), otherwise the migration will be repeatedly triggered for any further SRU's of this package.

Thanks!

James

Revision history for this message
Michael Bienia (geser) wrote :

New debdiff with fixed version number in the scripts.

Revision history for this message
Iain Lane (laney) wrote :

Sponsored, thank you

Changed in python-babel (Ubuntu Trusty):
status: New → In Progress
assignee: nobody → Michael Bienia (geser)
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Tristan, or anyone else affected,

Accepted python-babel into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/python-babel/1.3+dfsg.1-2ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python-babel (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [python-babel/trusty] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for trusty for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
Revision history for this message
Mathew Hodson (mhodson) wrote :

Verified that I could list locales after upgrading from 0.9.6-1build1 to 1.3+dfsg.1-2ubuntu1 then 1.3+dfsg.1-2ubuntu2

I also verified it was fixed after upgrading from 0.9.6-1build1 directly to 1.3+dfsg.1-2ubuntu2

tags: added: verification-done
removed: removal-candidate verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-babel - 1.3+dfsg.1-2ubuntu2

---------------
python-babel (1.3+dfsg.1-2ubuntu2) trusty; urgency=medium

  * Backport the python-babel package scripts from 1.3+dfsg.1-3 to fix upgrade
    issue with the directory to symlink conversion (lp: #1299442)
 -- Michael Bienia <email address hidden> Sun, 18 May 2014 11:55:11 +0200

Changed in python-babel (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for python-babel has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.