Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
90a24270
Commit
90a24270
authored
May 18, 2013
by
Richard Oudkerk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close file before reopening to keep Windows happy in test_sax.
parent
636f93c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
Lib/test/test_sax.py
Lib/test/test_sax.py
+6
-5
No files found.
Lib/test/test_sax.py
View file @
90a24270
...
...
@@ -578,13 +578,14 @@ class StreamReaderWriterXmlgenTest(XmlgenTest, unittest.TestCase):
writer
.
close
()
support
.
unlink
(
self
.
fname
)
self
.
addCleanup
(
cleanup
)
writer
.
getvalue
=
self
.
getvalue
def
getvalue
():
# Windows will not let use reopen without first closing
writer
.
close
()
with
open
(
writer
.
name
,
'rb'
)
as
f
:
return
f
.
read
()
writer
.
getvalue
=
getvalue
return
writer
def
getvalue
(
self
):
with
open
(
self
.
fname
,
'rb'
)
as
f
:
return
f
.
read
()
def
xml
(
self
,
doc
,
encoding
=
'iso-8859-1'
):
return
(
'<?xml version="1.0" encoding="%s"?>
\
n
%s'
%
(
encoding
,
doc
)).
encode
(
'ascii'
,
'xmlcharrefreplace'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment