#12445 closed defect (fixed)
Test failures with Babel 2.3.1
| Reported by: | Ryan J Ollos | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.11 |
| Component: | i18n | Version: | |
| Severity: | normal | Keywords: | babel |
| Cc: | Branch: | ||
| Release Notes: |
Support Babel 2.3.2. |
||
| API Changes: | |||
| Internal Changes: | |||
Description
======================================================================
ERROR: test_i18n_parse_date_roundtrip (trac.util.tests.datefmt.I18nDateFormatTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/tests/datefmt.py", line 1440, in test_i18n_parse_date_roundtrip
locale=locale)
File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/datefmt.py", line 305, in format_datetime
return _format_datetime(t, format, tzinfo, locale, 'datetime')
File "/Users/rjollos/Documents/Workspace/trac-dev/teo-rjollos.git/trac/util/datefmt.py", line 285, in _format_datetime
return babel_format_datetime(t, format, None, locale)
File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/babel/dates.py", line 721, in format_datetime
locale=locale)) \
File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/babel/dates.py", line 787, in format_time
return parse_pattern(format).apply(time, locale)
File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/babel/dates.py", line 1208, in apply
return self % DateTimeFormat(datetime, locale)
File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/babel/dates.py", line 1205, in __mod__
return self.format % other
File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/babel/dates.py", line 1242, in __getitem__
return self.format_period(char)
File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/babel/dates.py", line 1384, in format_period
return get_period_names(locale=self.locale)[period]
File "/Users/rjollos/Documents/Workspace/trac-dev/pve/lib/python2.7/site-packages/babel/localedata.py", line 207, in __getitem__
orig = val = self._data[key]
KeyError: 'pm'
----------------------------------
Attachments (0)
Change History (8)
comment:1 by , 10 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:2 by , 10 years ago
Would it make sense to pin the Babel version in .travis.yml and contrib/appveyor.ps1 until a fix is available?
comment:3 by , 10 years ago
That makes sense. I'll push it. Babel 2.3.0 has a packaging issue that missing babel/locale-data directory.
-
.travis.yml
diff --git a/.travis.yml b/.travis.yml index 986e4583e..7cbfb668a 100644
a b before_install: 15 15 - mysql -u root -e "CREATE USER tracuser@localhost IDENTIFIED BY 'password';" 16 16 - mysql -u root -e "GRANT ALL ON trac.* TO tracuser@localhost; FLUSH PRIVILEGES;" 17 17 install: 18 - pip install -q Genshi==0.7 Babelconfigobj Pygments docutils lxml pytz twill==0.9.1 psycopg2 MySQL-python18 - pip install -q Genshi==0.7 'Babel<2.3.0' configobj Pygments docutils lxml pytz twill==0.9.1 psycopg2 MySQL-python 19 19 - echo ".uri = $TRAC_TEST_DB_URI" >Makefile.cfg 20 20 addons: 21 21 apt: -
contrib/appveyor.ps1
diff --git a/contrib/appveyor.ps1 b/contrib/appveyor.ps1 index f1a318ce9..25f85b5a5 100644
a b $pgPassword = 'Password12!' 54 54 55 55 $pipCommonPackages = @( 56 56 'genshi', 57 'babel ',57 'babel<2.3.0', 58 58 'twill==0.9.1', 59 59 'configobj', 60 60 'docutils',
follow-up: 8 comment:5 by , 10 years ago
get_period_names() accepts context parameter since Babel 2.3.0. We should pass context='format' to it.
Proposed changes in jomae.git@t12445.
comment:6 by , 10 years ago
Strange error: https://travis-ci.org/edgewall/trac/jobs/121694329
$ pip --version pip 6.0.7 from /home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages (python 2.6) ... $ pip install -q Genshi==0.7 'Babel<2.3.0,>=2.3.2' configobj Pygments docutils lxml pytz twill==0.9.1 psycopg2 MySQL-python Could not find a version that satisfies the requirement Babel<2.3.0,>=2.3.2 (from versions: 0.9.6, 1.0, 1.1, 1.2, 1.3, 2.0, 2.1.1, 2.2.0, 2.3.0, 2.3.1, 2.3.2) No distributions matching the version for Babel<2.3.0,>=2.3.2
With pip 1.5.4, Babel 2.3.2 is installed as expected.
$ /dev/shm/babel231/bin/pip --version pip 1.5.4 from /dev/shm/babel231/local/lib/python2.7/site-packages (python 2.7) $ /dev/shm/babel231/bin/pip install 'Babel<2.3.0,>=2.3.2' Downloading/unpacking Babel<2.3.0,>=2.3.2 Using download cache from /home/jun66j5/arc/pip/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fpy2.py3%2FB%2FBabel%2FBabel-2.3.2-py2.py3-none-any.whl Downloading/unpacking pytz>=0a (from Babel<2.3.0,>=2.3.2) Using download cache from /home/jun66j5/arc/pip/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fpy2.py3%2Fp%2Fpytz%2Fpytz-2016.3-py2.py3-none-any.whl Installing collected packages: Babel, pytz Successfully installed Babel pytz Cleaning up...
Hmm. Use Babel!=2.3.0,!=2.3.1 instead of Babel<2.3.0,>=2.3.2, confirmed with pip 1.5.4, 6.0.7, 7.1.2 and 8.1.1.
comment:7 by , 10 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Committed in [14696:14697] and merged to trunk in [14698].
comment:8 by , 5 years ago
Replying to Jun Omae:
get_period_names()acceptscontextparameter since Babel 2.3.0. We should passcontext='format'to it.
In r17402, added a hint so we can remove compatibility code if support for Babel < 2.3.1 is removed.
2.3.0 was not released due to deployment problems, so noted it as since 2.3.1, but effectively the same. This is the changeset.



I've filed in https://github.com/python-babel/babel/issues/378.