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