Commits

Antoine Pitrou committed 963f2e4

Kill raw_open()

Comments (0)

Files changed (3)

       '#!/usr/bin/env python3\n'
 
 
-.. method:: Path.raw_open(flags, mode=0o777)
-
-   Open the file pointed to by the path and return a numeric file descriptor,
-   as :func:`os.open` does::
-
-      >>> p = Path('setup.py')
-      >>> fd = p.raw_open(os.O_RDONLY)
-      >>> os.read(fd, 10)
-      b'#!/usr/bin'
-      >>> os.close(fd)
-
-
 .. method:: Path.rename(target)
 
    Rename this file or directory to the given *target*.  *target* can be
         import grp
         return grp.getgrgid(self.stat().st_gid).gr_name
 
-    def raw_open(self, flags, mode=0o777):
+    def _raw_open(self, flags, mode=0o777):
         """
         Open the file pointed by this path and return a file descriptor,
         as os.open() does.
         flags = os.O_CREAT
         if not exist_ok:
             flags |= os.O_EXCL
-        fd = self.raw_open(flags, mode)
+        fd = self._raw_open(flags, mode)
         os.close(fd)
 
     def mkdir(self, mode=0o777, parents=False):
         self.assertRaises(ValueError, next, it)
         self.assertRaises(ValueError, next, it2)
         self.assertRaises(ValueError, p.open)
-        self.assertRaises(ValueError, p.raw_open, os.O_RDONLY)
         self.assertRaises(ValueError, p.resolve)
         self.assertRaises(ValueError, p.absolute)
         self.assertRaises(ValueError, p.__enter__)