Compare commits

...

No commits in common. "c8-stream-3.8" and "c8-beta" have entirely different histories.

5 changed files with 105 additions and 126 deletions

View File

@ -1 +1 @@
5605f75353368d32500afb30e60fc8f0edbca506 SOURCES/Babel-2.7.0.tar.gz 9adbd49864392713c6a3080aeb0a9e6432577277 SOURCES/Babel-2.5.1.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/Babel-2.7.0.tar.gz SOURCES/Babel-2.5.1.tar.gz

View File

@ -1,5 +1,5 @@
diff --git a/babel/localedata.py b/babel/localedata.py diff --git a/babel/localedata.py b/babel/localedata.py
index e012abb..dea0a0f 100644 index 4b6d3b6..080b723 100644
--- a/babel/localedata.py --- a/babel/localedata.py
+++ b/babel/localedata.py +++ b/babel/localedata.py
@@ -13,6 +13,8 @@ @@ -13,6 +13,8 @@
@ -9,17 +9,17 @@ index e012abb..dea0a0f 100644
+import re +import re
+import sys +import sys
import threading import threading
from collections import MutableMapping
from itertools import chain from itertools import chain
@@ -33,6 +35,7 @@ def get_base_dir():
@@ -22,6 +24,7 @@ from babel._compat import pickle, string_types, abc
_cache = {} _cache = {}
_cache_lock = threading.RLock() _cache_lock = threading.RLock()
_dirname = os.path.join(os.path.dirname(__file__), 'locale-data') _dirname = os.path.join(get_base_dir(), 'locale-data')
+_windows_reserved_name_re = re.compile("^(con|prn|aux|nul|com[0-9]|lpt[0-9])$", re.I) +_windows_reserved_name_re = re.compile("^(con|prn|aux|nul|com[0-9]|lpt[0-9])$", re.I)
def normalize_locale(name): def normalize_locale(name):
@@ -38,6 +41,22 @@ def normalize_locale(name): @@ -49,6 +52,22 @@ def normalize_locale(name):
return locale_id return locale_id
@ -42,7 +42,7 @@ index e012abb..dea0a0f 100644
def exists(name): def exists(name):
"""Check whether locale data is available for the given locale. """Check whether locale data is available for the given locale.
@@ -49,7 +68,7 @@ def exists(name): @@ -60,7 +79,7 @@ def exists(name):
return False return False
if name in _cache: if name in _cache:
return True return True
@ -69,10 +69,10 @@ index e012abb..dea0a0f 100644
if name != 'root' and merge_inherited: if name != 'root' and merge_inherited:
merge(data, pickle.load(fileobj)) merge(data, pickle.load(fileobj))
diff --git a/tests/test_localedata.py b/tests/test_localedata.py diff --git a/tests/test_localedata.py b/tests/test_localedata.py
index dbacba0..4730096 100644 index 3599b21..173e7a3 100644
--- a/tests/test_localedata.py --- a/tests/test_localedata.py
+++ b/tests/test_localedata.py +++ b/tests/test_localedata.py
@@ -11,11 +11,17 @@ @@ -11,12 +11,18 @@
# individuals. For the exact contribution history, see the revision # individuals. For the exact contribution history, see the revision
# history and logs, available at http://babel.edgewall.org/log/. # history and logs, available at http://babel.edgewall.org/log/.
@ -83,19 +83,19 @@ index dbacba0..4730096 100644
import unittest import unittest
import random import random
from operator import methodcaller from operator import methodcaller
import sys
-from babel import localedata -from babel import localedata, numbers
+import pytest +import pytest
+ +
+from babel import localedata, Locale, UnknownLocaleError +from babel import localedata, Locale, UnknownLocaleError, numbers
class MergeResolveTestCase(unittest.TestCase): class MergeResolveTestCase(unittest.TestCase):
@@ -131,3 +137,34 @@ def test_locale_identifiers_cache(monkeypatch):
localedata.locale_identifiers.cache = None @@ -117,3 +123,33 @@ def test_locale_argument_acceptance():
assert localedata.locale_identifiers() assert normalized_locale == None
assert len(listdir_calls) == 2 locale_exist = localedata.exists(['en_us', None])
+ assert locale_exist == False
+ +
+def test_locale_name_cleanup(): +def test_locale_name_cleanup():
+ """ + """

View File

@ -0,0 +1,15 @@
diff -up Babel-2.3.4/setup.py.orig Babel-2.3.4/setup.py
--- Babel-2.3.4/setup.py.orig 2016-04-11 11:58:25.000000000 +0200
+++ Babel-2.3.4/setup.py 2016-04-25 13:35:54.458765892 +0200
@@ -59,7 +59,10 @@ setup(
# This version identifier is currently necessary as
# pytz otherwise does not install on pip 1.4 or
# higher.
- 'pytz>=0a',
+ ### But the version confuses setuptools 8 and higher so remove it in the
+ ### system package
+ #'pytz>=0a',
+ 'pytz',
],
cmdclass={'import_cldr': import_cldr},

View File

@ -1,21 +1,29 @@
%global srcname Babel %global srcname Babel
%global sum Library for internationalizing Python applications %global sum Library for internationalizing Python applications
# On fedora 24 and beyond we want to use the python3 version by default
# (Only reason earlier versions aren't switched is that we didn't push it out
# before the release)
%if 0%{?fedora} >= 24 || 0%{?rhel} > 7
%global default_python 3
%else
%global default_python 2
%endif
# There is some bootstrapping involved when upgrading Python 3 # There is some bootstrapping involved when upgrading Python 3
# First of all we need babel (this package) to use sphinx # First of all we need babel (this package) to use sphinx
# And pytest is at this point not yet ready # And pytest is at this point not yet ready
%bcond_without bootstrap %global bootstrap 0
%bcond_with python2
Name: babel Name: babel
Version: 2.7.0 Version: 2.5.1
Release: 11%{?dist} Release: 7%{?dist}
Summary: Tools for internationalizing Python applications Summary: Tools for internationalizing Python applications
License: BSD License: BSD
URL: http://babel.pocoo.org/ URL: http://babel.pocoo.org/
Source0: https://files.pythonhosted.org/packages/source/B/%{srcname}/%{srcname}-%{version}.tar.gz Source0: https://files.pythonhosted.org/packages/source/B/%{srcname}/%{srcname}-%{version}.tar.gz
Patch0: babel-2.3.4-remove-pytz-version.patch
# Fix CVE-2021-20095: relative path traversal allows an attacker to load # Fix CVE-2021-20095: relative path traversal allows an attacker to load
# arbitrary locale files on disk and execute arbitrary code # arbitrary locale files on disk and execute arbitrary code
@ -24,34 +32,35 @@ Source0: https://files.pythonhosted.org/packages/source/B/%{srcname}/%{sr
Patch1: CVE-2021-20095.patch Patch1: CVE-2021-20095.patch
BuildArch: noarch BuildArch: noarch
# Exclude i686 arch. Due to a modularity issue it's being added to the
# x86_64 compose of CRB, but we don't want to ship it at all.
# See: https://projects.engineering.redhat.com/browse/RCM-72605
ExcludeArch: i686
%if %{with python2} %if 0%{?rhel} && 0%{?rhel} <= 7
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python2-setuptools BuildRequires: python2-setuptools
%if %{with python2_pytest}
BuildRequires: python2-pytz BuildRequires: python2-pytz
BuildRequires: python2-pytest BuildRequires: python2-pytest
BuildRequires: python2-freezegun
%endif %endif
%endif BuildRequires: python3-devel
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: platform-python-setuptools
BuildRequires: python%{python3_pkgversion}-setuptools %if !%{bootstrap}
BuildRequires: python%{python3_pkgversion}-rpm-macros BuildRequires: python3-pytz
%if !%{with bootstrap} BuildRequires: python3-pytest
BuildRequires: python%{python3_pkgversion}-pytz
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-freezegun
%endif %endif
# build the documentation # build the documentation
BuildRequires: make BuildRequires: make
%if !%{with bootstrap} %if %{default_python} >= 3
BuildRequires: python%{python3_pkgversion}-sphinx %if %{bootstrap}
BuildRequires: python2-sphinx
%else
BuildRequires: python3-sphinx
%endif
Requires: python3-babel
Requires: platform-python-setuptools
%else
BuildRequires: python2-sphinx
Requires: python2-babel
Requires: python2-setuptools
%endif %endif
@ -64,13 +73,11 @@ Babel is composed of two major parts:
providing access to various locale display names, localized number providing access to various locale display names, localized number
and date formatting, etc. and date formatting, etc.
%if %{with python2}
%package -n python2-babel %package -n python2-babel
Summary: %sum Summary: %sum
Requires: python2-setuptools Requires: python2-setuptools
Requires: python2-pytz Requires: pytz
%{?python_provide:%python_provide python2-babel} %{?python_provide:%python_provide python2-babel}
@ -82,18 +89,16 @@ Babel is composed of two major parts:
* a Python interface to the CLDR (Common Locale Data Repository), * a Python interface to the CLDR (Common Locale Data Repository),
providing access to various locale display names, localized number providing access to various locale display names, localized number
and date formatting, etc. and date formatting, etc.
%endif
%package -n python3-babel
%package -n python%{python3_pkgversion}-babel
Summary: %sum Summary: %sum
Requires: python%{python3_pkgversion}-setuptools Requires: platform-python-setuptools
Requires: python%{python3_pkgversion}-pytz Requires: python3-pytz
%{?python_provide:%python_provide python%{python3_pkgversion}-babel} %{?python_provide:%python_provide python3-babel}
%description -n python%{python3_pkgversion}-babel %description -n python3-babel
Babel is composed of two major parts: Babel is composed of two major parts:
* tools to build and work with gettext message catalogs * tools to build and work with gettext message catalogs
@ -102,7 +107,6 @@ Babel is composed of two major parts:
providing access to various locale display names, localized number providing access to various locale display names, localized number
and date formatting, etc. and date formatting, etc.
%if !%{with bootstrap}
%package doc %package doc
Summary: Documentation for Babel Summary: Documentation for Babel
Provides: python-babel-doc = %{version}-%{release} Provides: python-babel-doc = %{version}-%{release}
@ -111,130 +115,90 @@ Provides: python3-babel-doc = %{version}-%{release}
%description doc %description doc
Documentation for Babel Documentation for Babel
%endif
%prep %prep
%autosetup -n %{srcname}-%{version} -p1 %autosetup -n %{srcname}-%{version} -p1
%build %build
%if %{with python2} %if 0%{?rhel} && 0%{?rhel} <= 7
%py2_build %py2_build
%endif %endif
%py3_build %py3_build
BUILDDIR="$PWD/built-docs" BUILDDIR="$PWD/built-docs"
rm -rf "$BUILDDIR" rm -rf "$BUILDDIR"
%if !%{with bootstrap}
pushd docs pushd docs
make \ make \
%if %{default_python} >= 3 && !%{bootstrap}
SPHINXBUILD=sphinx-build-3 \ SPHINXBUILD=sphinx-build-3 \
%else
SPHINXBUILD=sphinx-build \
%endif
BUILDDIR="$BUILDDIR" \ BUILDDIR="$BUILDDIR" \
html html
popd popd
rm -f "$BUILDDIR/html/.buildinfo" rm -f "$BUILDDIR/html/.buildinfo"
%endif
%install %install
%if %{with python2} %if %{default_python} >= 3
%if 0%{?rhel} && 0%{?rhel} <= 7
%py2_install %py2_install
%endif %endif
%py3_install %py3_install
%else
mv %{buildroot}%{_bindir}/pybabel %{buildroot}%{_bindir}/pybabel-%{python3_version} %py3_install
%py2_install
%endif
%check %check
# test_frontend needs python-freezegun
rm tests/messages/test_frontend.py
export TZ=America/New_York export TZ=America/New_York
%if %{with python2} && %{with python2_pytest} %if 0%{?rhel} && 0%{?rhel} <= 7
%{__python2} -m pytest %{__python2} -m pytest
%endif %endif
%if !%{with bootstrap} %if !%{bootstrap}
%{__python3} -m pytest %{__python3} -m pytest
%endif %endif
%if %{with python2} %files
%files -n python2-babel
%doc CHANGES AUTHORS %doc CHANGES AUTHORS
%license LICENSE %license LICENSE
%if 0%{?rhel} && 0%{?rhel} <= 7
%files -n python2-babel
%{python2_sitelib}/Babel-%{version}-py*.egg-info %{python2_sitelib}/Babel-%{version}-py*.egg-info
%{python2_sitelib}/babel %{python2_sitelib}/babel
%endif %endif
%files -n python%{python3_pkgversion}-babel %files -n python3-babel
%doc CHANGES AUTHORS %{_bindir}/pybabel
%license LICENSE
%{python3_sitelib}/Babel-%{version}-py*.egg-info %{python3_sitelib}/Babel-%{version}-py*.egg-info
%{python3_sitelib}/babel %{python3_sitelib}/babel
%{_bindir}/pybabel-%{python3_version}
%if !%{with bootstrap}
%files doc %files doc
%doc built-docs/html/* %doc built-docs/html/*
%endif
%changelog %changelog
* Wed May 12 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.7.0-11 * Thu Jul 15 2021 Tomas Orsava <torsava@redhat.com> - 2.5.1-7
- Include the /usr/bin/pybabel binary that runs on Python 3.6 in the
python3-babel package
Resolves: rhbz#1967173
* Fri May 07 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.5.1-6
- Fix CVE-2021-20095 - Fix CVE-2021-20095
Resolves: rhbz#1955615 Resolves: rhbz#1955615
* Fri Dec 13 2019 Tomas Orsava <torsava@redhat.com> - 2.7.0-10 * Thu Mar 28 2019 Nils Philippsen <nils@redhat.com> - 2.5.1-5
- Exclude unsupported i686 arch - make spec file work without %%rhel being defined
* Tue Dec 03 2019 Tomas Orsava <torsava@redhat.com> - 2.7.0-9 * Tue Mar 26 2019 Nils Philippsen <nils@redhat.com> - 2.5.1-4
- Rename the pybabel executable to pybabel-3.8 and move it to the - depend on platform-python-setuptools rather than python3-setuptools (#1650487)
python38-babel package
* Wed Nov 20 2019 Lumír Balhar <lbalhar@redhat.com> - 2.7.0-8 * Mon Jun 18 2018 Petr Viktorin <pviktori@redhat.com> - 2.5.1-3
- Adjusted for Python 3.8 module in RHEL 8 - Remove the freezegun dependency
* Thu Oct 31 2019 Nils Philippsen <nils@tiptoe.de> - 2.7.0-7
- drop python2-babel only from F33 on as it is needed for trac (for the time
being, #1737930)
* Thu Oct 31 2019 Nils Philippsen <nils@tiptoe.de> - 2.7.0-6
- drop python2-babel from F32 on
* Fri Sep 13 2019 Miro Hrončok <mhroncok@redhat.com> - 2.7.0-5
- Reduce Python 2 build dependencies on Fedora 32
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 2.7.0-4
- Rebuilt for Python 3.8
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.7.0-3
- Bootstrap for Python 3.8
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon May 27 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 2.7.0-1
- update to upstream version 2.7.0
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 2.6.0-4
- Rebuilt for Python 3.7
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 2.6.0-3
- Rebuilt for Python 3.7
* Fri Jun 29 2018 Felix Schwarz <fschwarz@fedoraproject.org> - 2.6.0-2
- add setting to build without Python 2 support
* Fri Jun 29 2018 Felix Schwarz <fschwarz@fedoraproject.org> - 2.6.0-1
- update to upstream version 2.6.0
* Mon Jun 18 2018 Tomas Orsava <torsava@redhat.com> - 2.5.1-5
- Run tests in pytest (as declared in BuildRequires)
* Sat Jun 16 2018 Miro Hrončok <mhroncok@redhat.com> - 2.5.1-4
- Rebuilt for Python 3.7
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.5.1-3
- Bootstrap for Python 3.7
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-2 * Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild