mirror of
https://github.com/python/cpython.git
synced 2026-02-13 19:04:37 +00:00
Preserve the invariant tostring(elem) == b''.join(tostringlist(elem)) and add a test to make sure it keeps working
This commit is contained in:
parent
daa4c6b2e6
commit
426e248feb
2 changed files with 15 additions and 0 deletions
|
|
@ -1190,9 +1190,15 @@ class DataStream(io.BufferedIOBase):
|
|||
def writable(self):
|
||||
return True
|
||||
|
||||
def seekable(self):
|
||||
return True
|
||||
|
||||
def write(self, b):
|
||||
data.append(b)
|
||||
|
||||
def tell(self):
|
||||
return len(data)
|
||||
|
||||
ElementTree(element).write(DataStream(), encoding, method=method)
|
||||
return data
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue