Merge pull request #10955 from pytest-dev/backport-10954-to-7.3.x
[7.3.x] Fix couple of EncodingWarnings
This commit is contained in:
commit
384d54e11f
|
@ -953,7 +953,7 @@ class LocalPath:
|
||||||
else:
|
else:
|
||||||
p.dirpath()._ensuredirs()
|
p.dirpath()._ensuredirs()
|
||||||
if not p.check(file=1):
|
if not p.check(file=1):
|
||||||
p.open("w").close()
|
p.open("wb").close()
|
||||||
return p
|
return p
|
||||||
|
|
||||||
@overload
|
@overload
|
||||||
|
|
|
@ -27,7 +27,9 @@ def pytest_configure(config: Config) -> None:
|
||||||
import faulthandler
|
import faulthandler
|
||||||
|
|
||||||
stderr_fd_copy = os.dup(get_stderr_fileno())
|
stderr_fd_copy = os.dup(get_stderr_fileno())
|
||||||
config.stash[fault_handler_stderr_key] = open(stderr_fd_copy, "w")
|
config.stash[fault_handler_stderr_key] = open(
|
||||||
|
stderr_fd_copy, "w", encoding=sys.stderr.encoding
|
||||||
|
)
|
||||||
config.stash[fault_handler_originally_enabled_key] = faulthandler.is_enabled()
|
config.stash[fault_handler_originally_enabled_key] = faulthandler.is_enabled()
|
||||||
faulthandler.enable(file=config.stash[fault_handler_stderr_key])
|
faulthandler.enable(file=config.stash[fault_handler_stderr_key])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue