@SkipUnless(svntest.main.is_fs_type_fsfs)
@SkipUnless(svntest.main.server_enforces_UTF8_fspaths_in_verify)
def verify_non_utf8_paths(sbox):
    'svnadmin verify with non-UTF-8 paths'
    if ((svntest.main.options.fsfs_version is not None) and (svntest.main.options.fsfs_version not in [4, 6])):
        raise svntest.Skip('Unsupported prepackaged repository version')
    dumpfile = clean_dumpfile()
    sbox.build(empty=True, minor_version=min(svntest.main.options.server_minor_version, 8))
    load_and_verify_dumpstream(sbox, [], [], dumpfile_revisions, False, dumpfile, '--ignore-uuid')
    path1 = os.path.join(sbox.repo_dir, 'db', 'revs', '0', '1')
    path_new = os.path.join(sbox.repo_dir, 'db', 'revs', '0', '1.new')
    fp1 = open(path1, 'rb')
    fp_new = open(path_new, 'wb')
    for line in fp1.readlines():
        if (line == b'A\n'):
            fp_new.write(b'\xe6\n')
        elif (line == b'text: 1 340 32 32 a6be7b4cf075fd39e6a99eb69a31232b\n'):
            fp_new.write(b'text: 1 340 32 32 f2e93e73272cac0f18fccf16f224eb93\n')
        elif (line == b'text: 1 340 44 32 a6be7b4cf075fd39e6a99eb69a31232b\n'):
            fp_new.write(b'text: 1 340 44 32 f2e93e73272cac0f18fccf16f224eb93\n')
        elif (line == b'cpath: /A\n'):
            fp_new.write(b'cpath: /\xe6\n')
        elif (line == b'_0.0.t0-0 add-file true true /A\n'):
            fp_new.write(b'_0.0.t0-0 add-file true true /\xe6\n')
        else:
            fp_new.write(line)
    fp1.close()
    fp_new.close()
    os.remove(path1)
    os.rename(path_new, path1)
    (exit_code, output, errput) = svntest.main.run_svnadmin('verify', sbox.repo_dir)
    svntest.verify.verify_outputs("Unexpected error while running 'svnadmin verify'.", [], errput, None, ".*Path '.*' is not in UTF-8.*")
    expected_stderr = ['* Dumped revision 0.\n', "WARNING 0x0002: E160005: While validating fspath '?\\E6': Path '?\\E6' is not in UTF-8\n", '* Dumped revision 1.\n']
    (exit_code, output, errput) = svntest.main.run_svnadmin('dump', sbox.repo_dir)
    if svntest.verify.compare_and_display_lines("Output of 'svnadmin dump' is unexpected.", 'STDERR', expected_stderr, errput):
        raise svntest.Failure
svnadmin verify with non-UTF-8 paths
@SkipUnless(svntest.main.is_fs_type_fsfs)
@SkipUnless(svntest.main.server_enforces_UTF8_fspaths_in_verify)
def verify_non_utf8_paths(sbox):
    
    if ((svntest.main.options.fsfs_version is not None) and (svntest.main.options.fsfs_version not in [4, 6])):
        raise svntest.Skip('Unsupported prepackaged repository version')
    dumpfile = clean_dumpfile()
    sbox.build(empty=True, minor_version=min(svntest.main.options.server_minor_version, 8))
    load_and_verify_dumpstream(sbox, [], [], dumpfile_revisions, False, dumpfile, '--ignore-uuid')
    path1 = os.path.join(sbox.repo_dir, 'db', 'revs', '0', '1')
    path_new = os.path.join(sbox.repo_dir, 'db', 'revs', '0', '1.new')
    fp1 = open(path1, 'rb')
    fp_new = open(path_new, 'wb')
    for line in fp1.readlines():
        if (line == b'A\n'):
            fp_new.write(b'\xe6\n')
        elif (line == b'text: 1 340 32 32 a6be7b4cf075fd39e6a99eb69a31232b\n'):
            fp_new.write(b'text: 1 340 32 32 f2e93e73272cac0f18fccf16f224eb93\n')
        elif (line == b'text: 1 340 44 32 a6be7b4cf075fd39e6a99eb69a31232b\n'):
            fp_new.write(b'text: 1 340 44 32 f2e93e73272cac0f18fccf16f224eb93\n')
        elif (line == b'cpath: /A\n'):
            fp_new.write(b'cpath: /\xe6\n')
        elif (line == b'_0.0.t0-0 add-file true true /A\n'):
            fp_new.write(b'_0.0.t0-0 add-file true true /\xe6\n')
        else:
            fp_new.write(line)
    fp1.close()
    fp_new.close()
    os.remove(path1)
    os.rename(path_new, path1)
    (exit_code, output, errput) = svntest.main.run_svnadmin('verify', sbox.repo_dir)
    svntest.verify.verify_outputs("Unexpected error while running 'svnadmin verify'.", [], errput, None, ".*Path '.*' is not in UTF-8.*")
    expected_stderr = ['* Dumped revision 0.\n', "WARNING 0x0002: E160005: While validating fspath '?\\E6': Path '?\\E6' is not in UTF-8\n", '* Dumped revision 1.\n']
    (exit_code, output, errput) = svntest.main.run_svnadmin('dump', sbox.repo_dir)
    if svntest.verify.compare_and_display_lines("Output of 'svnadmin dump' is unexpected.", 'STDERR', expected_stderr, errput):
        raise svntest.Failure