Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r71245:ffea0e1ff052
Date: 2014-05-03 15:01 -0700
http://bitbucket.org/pypy/pypy/changeset/ffea0e1ff052/

Log:    refix: disallow unicode

diff --git a/pypy/module/_io/interp_bufferedio.py 
b/pypy/module/_io/interp_bufferedio.py
--- a/pypy/module/_io/interp_bufferedio.py
+++ b/pypy/module/_io/interp_bufferedio.py
@@ -711,7 +711,7 @@
     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:
diff --git a/pypy/module/_io/interp_fileio.py b/pypy/module/_io/interp_fileio.py
--- a/pypy/module/_io/interp_fileio.py
+++ b/pypy/module/_io/interp_fileio.py
@@ -340,7 +340,7 @@
     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)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to