Use with statement where it improves the documentation (closes #10461)
diff --git a/Doc/library/cmd.rst b/Doc/library/cmd.rst
index 464764d..b33d724 100644
--- a/Doc/library/cmd.rst
+++ b/Doc/library/cmd.rst
@@ -282,8 +282,8 @@
         def do_playback(self, arg):
             'Playback commands from a file:  PLAYBACK rose.cmd'
             self.close()
-            cmds = open(arg).read().splitlines()
-            self.cmdqueue.extend(cmds)
+            with open(arg) as f:
+                self.cmdqueue.extend(f.read().splitlines())
         def precmd(self, line):
             line = line.lower()
             if self.file and 'playback' not in line: