mirror of https://github.com/zulip/zulip.git
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:
parent
47f795ae64
commit
2bd635853b
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue