Message191563
I suggest that posixpath.c:_fd_converter() should PyObject_AsFileDescriptor() to convert a Python object to a fd integer. With PyObject_AsFileDescriptor() functions such as os.chmod() can be called with an opened file as first argument:
Now:
with open("somefile") as f:
os.chmod(f.fileno(), 0o644)
With PyObject_AsFileDescriptor():
with open("somefile") as f:
os.chmod(f, 0o644)
_fd_converter() also has more elaborate overflow checks. These checks should be added to PyObject_AsFileDescriptor(), too. |
|
Date |
User |
Action |
Args |
2013-06-21 11:12:42 | christian.heimes | set | recipients:
+ christian.heimes |
2013-06-21 11:12:42 | christian.heimes | set | messageid: <1371813162.19.0.902104537883.issue18276@psf.upfronthosting.co.za> |
2013-06-21 11:12:42 | christian.heimes | link | issue18276 messages |
2013-06-21 11:12:42 | christian.heimes | create | |
|