8556: ValueError: underlying buffer has been detached
The expat parser requires a binary mode file object.
This commit is contained in:
parent
cc6b54c5d9
commit
843795738d
@ -399,7 +399,7 @@ class ImportOpenFileContextManager:
|
|||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
if self.filename == '-':
|
if self.filename == '-':
|
||||||
self.filehandle = sys.stdin
|
self.filehandle = sys.stdin.buffer
|
||||||
else:
|
else:
|
||||||
self.filehandle = self.open_file(self.filename)
|
self.filehandle = self.open_file(self.filename)
|
||||||
return self.filehandle
|
return self.filehandle
|
||||||
|
Loading…
Reference in New Issue
Block a user