Lines Matching defs:open
26 # open() uses st_blksize whenever we can
39 # Does open() check its 'errors' argument?
55 that pass it to TextIOWrapper or open.
70 # Wrapper for builtins.open
72 # Trick so that open() won't become a bound method when stored
77 def open(file, mode="r", buffering=-1, encoding=None, errors=None,
89 opened. It defaults to 'r' which means open for reading in text mode. Other
101 'r' open for reading (default)
102 'w' open for writing, truncating the file first
103 'x' create a new file and open it for writing
104 'a' open for writing, appending to the end of the file if it exists
107 '+' open a disk file for updating (reading and writing)
110 The default mode is 'rt' (open for reading text). For binary random
170 be kept open when the file is closed. This does not work when a file name is
177 *opener* with (*file*, *flags*). *opener* must return an open file
178 descriptor (passing os.open as *opener* results in functionality similar to
181 open() returns a file object whose type depends on the mode, and
183 are performed. When open() is used to open a file in a text mode ('w',
184 'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open
298 return open(path, "rb")
308 # bpo-43680: Until Python 3.9, _pyio.open was not a static method and
309 # builtins.open was set to OpenWrapper to not become a bound method
310 # when set to a class variable. _io.open is a built-in function whereas
311 # _pyio.open is a Python function. In Python 3.10, _pyio.open() is now
312 # a static method, and builtins.open() is now io.open().
314 warnings.warn('OpenWrapper is deprecated, use open instead',
317 OpenWrapper = open
359 with open('spam.txt', 'r') as fp:
547 files, the newlines argument to open can be used to select the line
1510 *opener* must return an open file descriptor (passing os.open as *opener*
1576 fd = os.open(file, flags, 0o666)
1647 raise UnsupportedOperation('File not open for reading')
1651 raise UnsupportedOperation('File not open for writing')
2032 "use codecs.open() to handle arbitrary codecs")