mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Fix encoding issues in pytest stdio logs.
This commit is contained in:
parent
ca56bf70ba
commit
f1f539a7f6
1 changed files with 3 additions and 2 deletions
|
|
@ -5,7 +5,6 @@
|
|||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
import inspect
|
||||
import io
|
||||
import os
|
||||
import platform
|
||||
import py.path
|
||||
|
|
@ -68,7 +67,9 @@ def test_wrapper(request, long_tmpdir):
|
|||
|
||||
def write_log(filename, data):
|
||||
filename = os.path.join(options.log_dir, filename)
|
||||
with io.open(filename, "w", encoding="utf-8") as f:
|
||||
if not isinstance(data, bytes):
|
||||
data = data.encode("utf-8")
|
||||
with open(filename, "wb") as f:
|
||||
f.write(data)
|
||||
|
||||
print("\n") # make sure on-screen logs start on a new line
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue