diff options
author | 2008-10-01 21:41:43 +0000 | |
---|---|---|
committer | 2008-10-01 21:41:43 +0000 | |
commit | efc81bd2c8550fe8848523bb9e2f317044b7eaa2 (patch) | |
tree | 69887d0d6a77ef2f43e941365f49145db26fe30d /users | |
parent | Initial import, English revision 1.9; Translation by Michael Münch, thanks! (diff) | |
download | gentoo-efc81bd2c8550fe8848523bb9e2f317044b7eaa2.tar.gz gentoo-efc81bd2c8550fe8848523bb9e2f317044b7eaa2.tar.bz2 gentoo-efc81bd2c8550fe8848523bb9e2f317044b7eaa2.zip |
Issue warning if Unicode is seen.
Diffstat (limited to 'users')
-rw-r--r-- | users/antarus/projects/infra/use_desc_gen.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/users/antarus/projects/infra/use_desc_gen.py b/users/antarus/projects/infra/use_desc_gen.py index bddc673dcf..b9af8fc660 100644 --- a/users/antarus/projects/infra/use_desc_gen.py +++ b/users/antarus/projects/infra/use_desc_gen.py @@ -79,8 +79,11 @@ def FindMetadataFiles(repo_path, category_path, output=sys.stdout): metadata = GetLocalFlagInfoFromMetadataXml(f) pkg_split = pkg_path.split('/') for k, v in metadata.iteritems(): - output.write('%s/%s:%s - %s\n' % (pkg_split[-2] ,pkg_split[-1], k, v)) - + try: + output.write('%s/%s:%s - %s\n' % (pkg_split[-2] ,pkg_split[-1], k, v)) + except UnicodeEncodeError, e: + logging.error('Unicode found in %s, not generating to output' % (pkg_path)) + continue def _GetTextFromNode(node): """Given an XML node, try to turn all it's children into text. |