# HG changeset patch # User Milka Kuzminski # Date 2021-03-09 20:14:43 # Node ID 8b3be25b53390670d69a2e801fac9529b70873a0 # Parent b5d589019517115366bc19052a3668351942a6d0 svn: fix subprocess problems on some of the calls for file checking. diff --git a/vcsserver/svn.py b/vcsserver/svn.py --- a/vcsserver/svn.py +++ b/vcsserver/svn.py @@ -38,6 +38,7 @@ import svn.repos from vcsserver import svn_diff, exceptions, subprocessio, settings from vcsserver.base import RepoFactory, raise_from_original, ArchiveNode, archive_repo from vcsserver.exceptions import NoContentException +from vcsserver.utils import safe_str from vcsserver.vcs_base import RemoteBase log = logging.getLogger(__name__) @@ -483,9 +484,7 @@ class SvnRemote(RemoteBase): if path and os.path.isdir(path): opts['cwd'] = path - safe_call = False - if '_safe' in opts: - safe_call = True + safe_call = opts.pop('_safe', False) svnenv = os.environ.copy() svnenv.update(opts.pop('extra_env', {})) @@ -499,7 +498,7 @@ class SvnRemote(RemoteBase): return ''.join(p), ''.join(p.error) except (EnvironmentError, OSError) as err: if safe_call: - return '', err + return '', safe_str(err).strip() else: cmd = ' '.join(cmd) # human friendly CMD tb_err = ("Couldn't run svn command (%s).\n"