<html><body>On 12:37 am, brett@python.org wrote:<br /><br />&gt;For security reasons I might be asking for file's constructor to be<br />&gt;removed from the type for Python source code at some point (it can be<br />&gt;relocated to an extension module if desired). &#160;By forcing people to go<br />&gt;through open() to create a file object you can more easily control<br />&gt;read/write access to the file system (assuming the proper importation<br />&gt;of extension modules has been blocked). &#160;Not removing the constructor<br />&gt;allows any code that has been explicitly given a file object but not<br />&gt;open() to just get the class and call the constructor to open a new<br />&gt;file.<br /><br />This is a general problem with type access. &#160;Secure versions of any type should not allow access to the type period. &#160;It is hardly unique to files, and is not limited to constructors either. &#160;How do you, e.g., allow a restricted piece of code write access to only a specified area of the filesystem?<br /><br />More importantly, given the random behavior that open() will be growing (opening sockets? &#160;dynamic dispatch on URL scheme???) file() will likely remain a popular way to be sure you are accessing the filesystem.<br /><br /><br /><br /></body></html>