Lines Matching refs:fileobj
396 def __init__(self, fileobj, filename=None): argument
400 if isinstance(fileobj, string_types):
401 self._filename = fileobj
402 fileobj = open(fileobj, 'rb')
406 elif hasattr(fileobj, "name"):
407 self._filename = fileobj.name
409 self._filename = repr(fileobj)
411 if fileobj is not None:
413 fileobj = _ContextWrapper(fileobj)
415 with fileobj as file_stream:
426 def _read_tzfile(self, fileobj): argument
438 if fileobj.read(4).decode() != "TZif":
441 fileobj.read(16)
466 ) = struct.unpack(">6l", fileobj.read(24))
477 fileobj.read(timecnt*4)))
490 fileobj.read(timecnt))
508 ttinfo.append(struct.unpack(">lbb", fileobj.read(6)))
510 abbr = fileobj.read(charcnt).decode()
523 fileobj.seek(leapcnt * 8, os.SEEK_CUR)
535 fileobj.read(ttisstdcnt))
547 fileobj.read(ttisgmtcnt))
1196 def __init__(self, fileobj): argument
1200 if isinstance(fileobj, string_types):
1201 self._s = fileobj
1203 fileobj = open(fileobj, 'r')
1205 self._s = getattr(fileobj, 'name', repr(fileobj))
1206 fileobj = _ContextWrapper(fileobj)
1210 with fileobj as fobj: