1. Ronny Pfannschmidt
  2. pylib-hacks

Commits

holger krekel  committed 95f4053

also use codecs.open for reading back

  • Participants
  • Parent commits 8a5d119
  • Branches default

Comments (0)

Files changed (1)

File testing/io_/test_terminalwriter.py

View file
 import py
 import os, sys
 from py._io import terminalwriter
+import codecs
 
 def test_get_terminal_width():
     x = py.io.get_terminal_width
         if request.param == "path":
             tmpdir = request.getfuncargvalue("tmpdir")
             p = tmpdir.join("tmpfile")
-            import codecs
             f = codecs.open(str(p), 'w+', encoding='utf8')
             tw = py.io.TerminalWriter(f)
             def getlines():
                 tw._file.flush()
-                return p.open('r').readlines()
+                return codecs.open(str(p), 'r',
+                    encoding='utf8').readlines()
         elif request.param == "stringio":
             tw = py.io.TerminalWriter(stringio=True)
             def getlines():