Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 636f93c commit 90a2427Copy full SHA for 90a2427
1 file changed
Lib/test/test_sax.py
@@ -578,13 +578,14 @@ def cleanup():
578
writer.close()
579
support.unlink(self.fname)
580
self.addCleanup(cleanup)
581
- writer.getvalue = self.getvalue
+ def getvalue():
582
+ # Windows will not let use reopen without first closing
583
+ writer.close()
584
+ with open(writer.name, 'rb') as f:
585
+ return f.read()
586
+ writer.getvalue = getvalue
587
return writer
588
- def getvalue(self):
- with open(self.fname, 'rb') as f:
- return f.read()
-
589
def xml(self, doc, encoding='iso-8859-1'):
590
return ('<?xml version="1.0" encoding="%s"?>\n%s' %
591
(encoding, doc)).encode('ascii', 'xmlcharrefreplace')
0 commit comments