Skip to content

Commit f775e93

Browse files
authored
Tests: Open SVN dump file in binary mode to prevent UnicodeDecodeError
The function `_create_svn_initools_repo` in `tests/lib/local_repos.py` was opening a downloaded SVN dump file using the default text mode (`'r'`). Because SVN dump files contain binary data, this caused a `UnicodeDecodeError` on Windows and corrupted data due to newline translation when piping to `svnadmin`. This commit changes the `open()` call to use `'rb'` (binary mode) to ensure the raw bytes are passed to `svnadmin` correctly.
1 parent 915976c commit f775e93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/lib/local_repos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def _create_svn_initools_repo(initools_dir: str) -> None:
1818
"http://bitbucket.org/hltbra/pip-initools-dump/raw/8b55c908a320/"
1919
"INITools_modified.dump"
2020
)
21-
with open(filename) as dump:
21+
with open(filename, "rb") as dump:
2222
subprocess.check_call(
2323
["svnadmin", "load", initools_dir],
2424
stdin=dump,

0 commit comments

Comments
 (0)