Commits

Philip Jenvey  committed ffea0e1

refix: disallow unicode

  • Participants
  • Parent commits 051596e
  • Branches py3k

Comments (0)

Files changed (2)

File pypy/module/_io/interp_bufferedio.py

     def write_w(self, space, w_data):
         self._check_init(space)
         self._check_closed(space, "write to closed file")
-        data = space.getarg_w('s*', w_data).as_str()
+        data = space.bufferstr_w(w_data)
         size = len(data)
 
         with self.lock:

File pypy/module/_io/interp_fileio.py

     def write_w(self, space, w_data):
         self._check_closed(space)
         self._check_writable(space)
-        data = space.getarg_w('s*', w_data).as_str()
+        data = space.bufferstr_w(w_data)
 
         try:
             n = os.write(self.fd, data)