Author: Brian Kearns <[email protected]>
Branch:
Changeset: r73362:7026746cbb1b
Date: 2014-09-07 12:14 -0700
http://bitbucket.org/pypy/pypy/changeset/7026746cbb1b/
Log: rfile fdopen needs validate_fd for win32
diff --git a/rpython/rlib/rfile.py b/rpython/rlib/rfile.py
--- a/rpython/rlib/rfile.py
+++ b/rpython/rlib/rfile.py
@@ -155,9 +155,11 @@
def create_fdopen_rfile(fd, mode="r"):
mode = _sanitize_mode(mode)
+ fd = rffi.cast(rffi.INT, fd)
+ rposix.validate_fd(fd)
ll_mode = rffi.str2charp(mode)
try:
- ll_file = c_fdopen(rffi.cast(rffi.INT, fd), ll_mode)
+ ll_file = c_fdopen(fd, ll_mode)
if not ll_file:
errno = rposix.get_errno()
raise OSError(errno, os.strerror(errno))
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -119,7 +119,7 @@
return 1
def validate_fd(fd):
- return 1
+ pass
def closerange(fd_low, fd_high):
# this behaves like os.closerange() from Python 2.6.
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit