From 0d5b0fbd79ba8b2e7dd5d2f2db7d69cad3e56766 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 22 Sep 2012 14:52:35 -0700 Subject: Use re.UNICODE for category/package name regexes. This only affects r'\w' with Python 2.x, since Python 3 already defaults to re.UNICODE behavior when compiling unicode str objects (unless re.ASCII is specified). If a repository wants to ban unicode categore/package names then we can add a layout.conf setting for that, as discussed in bug #435934. --- pym/portage/versions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pym/portage/versions.py') diff --git a/pym/portage/versions.py b/pym/portage/versions.py index 242623fde..a9b7e64fe 100644 --- a/pym/portage/versions.py +++ b/pym/portage/versions.py @@ -79,7 +79,7 @@ def _get_pv_re(eapi_attrs): else: pv_re = _pv['dots_disallowed_in_PN'] - pv_re = re.compile('^' + pv_re + '$', re.VERBOSE) + pv_re = re.compile(_unicode_decode('^' + pv_re + '$'), re.VERBOSE | re.UNICODE) _pv_re_cache[cache_key] = pv_re return pv_re @@ -292,7 +292,7 @@ def _pkgsplit(mypkg, eapi=None): return (m.group('pn'), m.group('ver'), rev) -_cat_re = re.compile('^%s$' % _cat) +_cat_re = re.compile('^%s$' % _cat, re.UNICODE) _missing_cat = 'null' def catpkgsplit(mydata, silent=1, eapi=None): -- cgit v1.2.3-1-g7c22