From 783610f92c867c250af5eeb84b238fa58770ae7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= Date: Wed, 30 Oct 2024 17:46:39 +0900 Subject: [PATCH] repozo: fix recover on stdout (#405) This was working on python2, but on python3, repozo -v --recover --repository backups/ > restored.fs failed with TypeError: write() argument must be str, not bytes --- CHANGES.rst | 2 ++ src/ZODB/scripts/repozo.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 668d55655..4bdbfea0c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,8 @@ 6.0.1 (unreleased) ================== + - repozo: fix restoring on stdout. + - repozo: prevent an incorrect "option ignored" warning when running backup or verify. diff --git a/src/ZODB/scripts/repozo.py b/src/ZODB/scripts/repozo.py index 083a8c293..8dce5dc80 100755 --- a/src/ZODB/scripts/repozo.py +++ b/src/ZODB/scripts/repozo.py @@ -685,7 +685,7 @@ def do_recover(options): files_to_close = () if options.output is None: log('Recovering file to stdout') - outfp = sys.stdout + outfp = sys.stdout.buffer else: # Delete old ZODB before recovering backup as size of # old ZODB + full partial file may be superior to free disk space