diff --git a/swh/loader/svn/ra.py b/swh/loader/svn/ra.py --- a/swh/loader/svn/ra.py +++ b/swh/loader/svn/ra.py @@ -8,6 +8,7 @@ """ import click +import codecs import os import shutil import tempfile @@ -101,6 +102,19 @@ return filetype == b'link', src +def _ra_codecs_error_handler(e): + """Subvertpy may fail to decode to utf-8 the user svn properties. As + they are not used by the loader, return an empty string instead + of the decoded content. + + Args: + e (UnicodeDecodeError): exception raised during the svn + properties decoding. + + """ + return u"", e.end + + DEFAULT_FLAG = 0 EXEC_FLAG = 1 NOEXEC_FLAG = 2 @@ -412,7 +426,9 @@ The updated root directory """ + codecs.register_error("strict", _ra_codecs_error_handler) self.conn.replay(rev, rev+1, self.editor) + codecs.register_error("strict", codecs.strict_errors) return self.editor.directory def compute_hashes(self, rev):