Home
last modified time | relevance | path

Searched refs:fileobj (Results 1 - 25 of 33) sorted by relevance

12

/third_party/python/Lib/
H A Dselectors.py21 def _fileobj_to_fd(fileobj):
25 fileobj -- file object or file descriptor
33 if isinstance(fileobj, int):
34 fd = fileobj
37 fd = int(fileobj.fileno())
40 "{!r}".format(fileobj)) from None
46 SelectorKey = namedtuple('SelectorKey', ['fileobj', 'fd', 'events', 'data'])
48 SelectorKey.__doc__ = """SelectorKey(fileobj, fd, events, data)
53 SelectorKey.fileobj.__doc__ = 'File object registered.'
69 def __getitem__(self, fileobj)
[all...]
H A Dtarfile.py240 """Copy length bytes from fileobj src to fileobj dst.
343 def __init__(self, name, mode, comptype, fileobj, bufsize):
347 if fileobj is None:
348 fileobj = _LowLevelFile(name, mode)
354 fileobj = _StreamProxy(fileobj)
355 comptype = fileobj.getcomptype()
360 self.fileobj = fileobj
[all...]
H A Dgzip.py135 compresslevel=_COMPRESS_LEVEL_BEST, fileobj=None, mtime=None):
138 At least one of fileobj and filename must be given a
141 The new class instance is based on fileobj, which can be a regular
146 When fileobj is not None, the filename argument is only used to be
149 fileobj, if discernible; otherwise, it defaults to the empty string,
154 is the mode of fileobj if discernible; otherwise, the default is 'rb'.
173 if fileobj is None:
174 fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
176 filename = getattr(fileobj, 'name', '')
183 mode = getattr(fileobj, 'mod
[all...]
H A Dhashlib.py257 def file_digest(fileobj, digest, /, *, _bufsize=2**18):
260 *fileobj* must be a file-like object opened for reading in binary mode.
275 if hasattr(fileobj, "getbuffer"):
277 digestobj.update(fileobj.getbuffer())
282 hasattr(fileobj, "readinto")
283 and hasattr(fileobj, "readable")
284 and fileobj.readable()
287 f"'{fileobj!r}' is not a file-like object in binary reading mode."
295 size = fileobj.readinto(buf)
H A Dsubprocess.py2115 if key.fileobj is self.stdin:
2121 selector.unregister(key.fileobj)
2122 key.fileobj.close()
2125 selector.unregister(key.fileobj)
2126 key.fileobj.close()
2127 elif key.fileobj in (self.stdout, self.stderr):
2130 selector.unregister(key.fileobj)
2131 key.fileobj.close()
2132 self._fileobj2output[key.fileobj].append(data)
H A Dtelnetlib.py550 if key.fileobj is self:
559 elif key.fileobj is sys.stdin:
H A Dzipfile.py784 fileobj = self._file
786 self._close(fileobj)
823 def __init__(self, fileobj, mode, zipinfo, pwd=None,
825 self._fileobj = fileobj
852 if fileobj.seekable():
853 self._orig_compress_start = fileobj.tell()
/third_party/python/Lib/test/
H A Dtest_csv.py138 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
139 writer = csv.writer(fileobj, **kwargs)
141 fileobj.seek(0)
142 self.assertEqual(fileobj.read(),
146 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
147 writer = csv.writer(fileobj, **kwargs)
150 fileobj.seek(0)
151 self.assertEqual(fileobj.read(), '')
248 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
249 writer = csv.writer(fileobj)
[all...]
H A Dtest_gzip.py147 f = gzip.GzipFile(fileobj=io.BytesIO(compressed), mode='rb')
157 fileobj = f.fileobj
158 self.assertFalse(fileobj.closed)
160 self.assertTrue(fileobj.closed)
169 fileobj = f.fileobj
170 self.assertFalse(fileobj.closed)
172 self.assertTrue(fileobj.closed)
303 self.assertTrue(hasattr(f.fileobj, "nam
[all...]
H A Dtest_telnetlib.py131 def register(self, fileobj, events, data=None):
132 key = selectors.SelectorKey(fileobj, 0, events, data)
133 self.keys[fileobj] = key
136 def unregister(self, fileobj):
137 return self.keys.pop(fileobj)
141 for fileobj in self.keys:
142 if isinstance(fileobj, TelnetAlike):
143 block = fileobj.sock.block
H A Dtest_tarfile.py125 "fileobj.readlines() failed")
127 "fileobj.readlines() failed")
131 "fileobj.readlines() failed")
141 "fileobj.__iter__() failed")
496 with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
505 tar = tarfile.open(fileobj=fobj, mode=self.mode)
513 with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
517 # Issue 21044: tarfile.open() should handle fileobj with an integer
522 with tarfile.open(fileobj=fobj, mode=self.mode) as tar:
530 with tarfile.open(fileobj
[all...]
H A Dtest_imp.py247 fileobj, pathname, description = imp.find_module(m)
248 fileobj.close()
H A Dtest_sax.py205 fileobj = None
208 nonlocal fileobj
209 fileobj = builtin_open(*args)
210 return fileobj
216 self.assertTrue(fileobj.closed)
/third_party/python/Tools/tz/
H A Dzdump.py18 def fromfile(cls, fileobj):
19 if fileobj.read(4).decode() != "TZif":
21 fileobj.seek(20)
22 header = fileobj.read(24)
26 transitions.fromfile(fileobj, tzh_timecnt)
31 type_indices.fromfile(fileobj, tzh_timecnt)
35 ttis.append(ttinfo._make(struct.unpack(">lbb", fileobj.read(6))))
37 abbrs = fileobj.read(tzh_charcnt)
79 with open(filepath, 'rb') as fileobj:
80 tzi = TZInfo.fromfile(fileobj)
[all...]
/third_party/skia/third_party/externals/dawn/scripts/
H A Dextract.py39 def __init__(self, path, mode, fileobj):
42 self.fileobj = fileobj
155 shutil.copyfileobj(entry.fileobj, out)
/third_party/python/Objects/
H A Dmoduleobject.c525 PyObject *fileobj; in PyModule_GetFilenameObject() local
532 (fileobj = PyDict_GetItemWithError(d, &_Py_ID(__file__))) == NULL || in PyModule_GetFilenameObject()
533 !PyUnicode_Check(fileobj)) in PyModule_GetFilenameObject()
540 Py_INCREF(fileobj); in PyModule_GetFilenameObject()
541 return fileobj; in PyModule_GetFilenameObject()
547 PyObject *fileobj; in PyModule_GetFilename() local
549 fileobj = PyModule_GetFilenameObject(m); in PyModule_GetFilename()
550 if (fileobj == NULL) in PyModule_GetFilename()
552 utf8 = PyUnicode_AsUTF8(fileobj); in PyModule_GetFilename()
553 Py_DECREF(fileobj); /* modul in PyModule_GetFilename()
[all...]
/third_party/python/Lib/test/test_asyncio/
H A Dutils.py324 def register(self, fileobj, events, data=None):
325 key = selectors.SelectorKey(fileobj, 0, events, data)
326 self.keys[fileobj] = key
329 def unregister(self, fileobj):
330 return self.keys.pop(fileobj)
/third_party/python/Python/
H A Derrors.c1733 PyObject *fileobj; in PyErr_SyntaxLocationEx() local
1735 fileobj = PyUnicode_DecodeFSDefault(filename); in PyErr_SyntaxLocationEx()
1736 if (fileobj == NULL) { in PyErr_SyntaxLocationEx()
1741 fileobj = NULL; in PyErr_SyntaxLocationEx()
1743 PyErr_SyntaxLocationObject(fileobj, lineno, col_offset); in PyErr_SyntaxLocationEx()
1744 Py_XDECREF(fileobj); in PyErr_SyntaxLocationEx()
/third_party/python/Lib/asyncio/
H A Dselector_events.py735 fileobj, (reader, writer) = key.fileobj, key.data
738 self._remove_reader(fileobj)
743 self._remove_writer(fileobj)
/third_party/node/deps/v8/third_party/jinja2/
H A Dext.py619 def babel_extract(fileobj, keywords, comment_tags, options):
638 :param fileobj: the file-like object the messages should be extracted from
683 source = fileobj.read().decode(options.get("encoding", "utf-8"))
/third_party/node/tools/inspector_protocol/jinja2/
H A Dext.py542 def babel_extract(fileobj, keywords, comment_tags, options):
561 :param fileobj: the file-like object the messages should be extracted from
607 source = fileobj.read().decode(options.get('encoding', 'utf-8'))
/third_party/skia/third_party/externals/jinja2/
H A Dext.py619 def babel_extract(fileobj, keywords, comment_tags, options):
638 :param fileobj: the file-like object the messages should be extracted from
683 source = fileobj.read().decode(options.get("encoding", "utf-8"))
/third_party/python/Lib/multiprocessing/
H A Dforkserver.py218 rfds = [key.fileobj for (key, events) in selector.select()]
/third_party/python/Lib/xmlrpc/
H A Dclient.py1049 with gzip.GzipFile(mode="wb", fileobj=f, compresslevel=1) as gzf:
1072 with gzip.GzipFile(mode="rb", fileobj=BytesIO(data)) as gzf:
1101 gzip.GzipFile.__init__(self, mode="rb", fileobj=self.io)
/third_party/jinja2/
H A Dext.py774 fileobj: t.BinaryIO,
801 :param fileobj: the file-like object the messages should be extracted from
850 source = fileobj.read().decode(options.get("encoding", "utf-8"))

Completed in 54 milliseconds

12