diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-12-12 04:52:43 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-12-12 04:52:43 +0100 |
commit | f9dfff45484636cb6a988827a60bfd8b82353221 (patch) | |
tree | 2f1e4032714a4469dafbea820b3d72549c0755ae /fastimport/parser.py | |
parent | eec113f4d5909772e18417c9b9116912e9fa7359 (diff) | |
download | python-fastimport-git-f9dfff45484636cb6a988827a60bfd8b82353221.tar.gz |
Avoid attempting to utf-8 decode/encode committer and author information.
Diffstat (limited to 'fastimport/parser.py')
-rw-r--r-- | fastimport/parser.py | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/fastimport/parser.py b/fastimport/parser.py index e6573e8..befff2a 100644 --- a/fastimport/parser.py +++ b/fastimport/parser.py @@ -530,24 +530,11 @@ class ImportParser(LineBasedParser): name = match.group(1) if len(name) > 0: if name[-1] == " ": - try: - name = name[:-1].decode('utf_8') - except UnicodeDecodeError: - # The spec says names are *typically* utf8 encoded - # but that isn't enforced by git-fast-export (at least) - self.warning("%s name not in utf8 - replacing unknown " - "characters" % (section,)) - name = name[:-1].decode('utf_8', 'replace') + name = name[:-1] email = match.group(2) # While it shouldn't happen, some datasets have email addresses # which contain unicode characters. See bug 338186. We sanitize # the data at this level just in case. - try: - email = email.decode('utf_8') - except UnicodeDecodeError: - self.warning("%s email not in utf8 - replacing unknown characters" - % (section,)) - email = email.decode('utf_8', 'replace') if self.user_mapper: name, email = self.user_mapper.map_name_and_email(name, email) return (name, email, when[0], when[1]) |