Use an explicit encoding when opening `os.devnul`
Although slightly pointless, this avoids an `EncodingWarning` in Python 3.10 or greater when running under the `-X warn_default_encoding` flag.
This commit is contained in:
parent
59b8ec3ce1
commit
594413e8f0
|
@ -381,7 +381,7 @@ class FDCaptureBinary:
|
||||||
self.targetfd_save = os.dup(targetfd)
|
self.targetfd_save = os.dup(targetfd)
|
||||||
|
|
||||||
if targetfd == 0:
|
if targetfd == 0:
|
||||||
self.tmpfile = open(os.devnull)
|
self.tmpfile = open(os.devnull, encoding="utf-8")
|
||||||
self.syscapture = SysCapture(targetfd)
|
self.syscapture = SysCapture(targetfd)
|
||||||
else:
|
else:
|
||||||
self.tmpfile = EncodedFile(
|
self.tmpfile = EncodedFile(
|
||||||
|
|
Loading…
Reference in New Issue