Edgewall Software
Modify

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#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 Jun Omae, 8 years ago

Owner: set to Jun Omae
Status: newassigned

comment:2 by Ryan J Ollos, 8 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 Jun Omae, 8 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:  
    1515  - mysql -u root -e "CREATE USER tracuser@localhost IDENTIFIED BY 'password';"
    1616  - mysql -u root -e "GRANT ALL ON trac.* TO tracuser@localhost; FLUSH PRIVILEGES;"
    1717install:
    18   - pip install -q Genshi==0.7 Babel configobj Pygments docutils lxml pytz twill==0.9.1 psycopg2 MySQL-python
     18  - pip install -q Genshi==0.7 'Babel<2.3.0' configobj Pygments docutils lxml pytz twill==0.9.1 psycopg2 MySQL-python
    1919  - echo ".uri = $TRAC_TEST_DB_URI" >Makefile.cfg
    2020addons:
    2121  apt:
  • contrib/appveyor.ps1

    diff --git a/contrib/appveyor.ps1 b/contrib/appveyor.ps1
    index f1a318ce9..25f85b5a5 100644
    a b $pgPassword = 'Password12!'  
    5454
    5555$pipCommonPackages = @(
    5656    'genshi',
    57     'babel',
     57    'babel<2.3.0',
    5858    'twill==0.9.1',
    5959    'configobj',
    6060    'docutils',

comment:4 by Jun Omae, 8 years ago

Applied in [14694] and [14695].

comment:5 by Jun Omae, 8 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 Jun Omae, 8 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.

Last edited 8 years ago by Jun Omae (previous) (diff)

comment:7 by Jun Omae, 8 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [14696:14697] and merged to trunk in [14698].

in reply to:  5 comment:8 by Ryan J Ollos, 4 years ago

Replying to Jun Omae:

get_period_names() accepts context parameter since Babel 2.3.0. We should pass context='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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.