diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml
index 1d3ba1f9ccc..509a37c78ae 100644
--- a/test/functional/tools/samples_tool_conf.xml
+++ b/test/functional/tools/samples_tool_conf.xml
@@ -24,7 +24,10 @@
+
diff --git a/test/tool_shed/base/twilltestcase.py b/test/tool_shed/base/twilltestcase.py
index c69c2265283..7a677c6667b 100644
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -539,7 +539,8 @@ class ShedTwillTestCase( TwillTestCase ):
self.submit_form( 'export_repository', 'export_repository_button' )
fd, capsule_filename = tempfile.mkstemp()
os.close( fd )
- file( capsule_filename, 'w' ).write( self.last_page() )
+ with open( capsule_filename, 'w' ) as f:
+ f.write( self.last_page() )
return capsule_filename
def fill_review_form( self, review_contents_dict, strings_displayed=[], strings_not_displayed=[] ):