test-run-dev: Fix log file opening.

Partially reverts commit cc55393671.
mode="r" cannot be combined with buffering=0.

This is not a correct thing to do, since a multibyte character might
get split between two binary reads and cause UnicodeDecodeError, but
it’s good enough for a known-broken test we don’t run.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-08-02 14:41:26 -07:00 committed by Tim Abbott
parent 47f795ae64
commit 2bd635853b
1 changed files with 3 additions and 3 deletions

View File

@ -17,13 +17,13 @@ TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
def start_server(logfile_name: str) -> Tuple[bool, str]:
failure = True
key = "Quit the server with CTRL-C."
key = "Quit the server with CONTROL-C."
datalog = []
with open(logfile_name, "r", buffering=0) as logfile:
with open(logfile_name, "rb", buffering=0) as logfile:
for i in range(200):
time.sleep(0.5)
print(f"{i}. Polling run-dev...")
new_data = logfile.read()
new_data = logfile.read().decode()
if new_data:
datalog.append(new_data)