• Home
  • Raw
  • Download

Lines Matching refs:tempfile

2 import tempfile
26 has_textmode = (tempfile._text_openflags != tempfile._bin_openflags)
73 dict = tempfile.__dict__
103 self.r = tempfile._RandomNameSequence()
181 cand = tempfile._candidate_tempdir_list()
197 cand = tempfile._candidate_tempdir_list()
223 our_temp_directory = tempfile.mkdtemp()
229 with support.swap_attr(tempfile, "_candidate_tempdir_list",
232 tempfile._get_default_tempdir()
241 tempfile._get_default_tempdir()
253 tempfile._get_default_tempdir()
267 obj = tempfile._get_candidate_names()
268 self.assertIsInstance(obj, tempfile._RandomNameSequence)
272 a = tempfile._get_candidate_names()
273 b = tempfile._get_candidate_names()
282 dir = tempfile.mkdtemp()
284 with support.swap_attr(tempfile, 'tempdir', dir):
291 return support.swap_attr(tempfile,
300 oldmode = mode = os.stat(tempfile.tempdir).st_mode
302 os.chmod(tempfile.tempdir, mode)
304 if os.access(tempfile.tempdir, os.W_OK):
309 self.assertEqual(os.listdir(tempfile.tempdir), [])
311 os.chmod(tempfile.tempdir, oldmode)
315 tempdir = os.path.join(tempfile.tempdir, 'nonexistent')
316 with support.swap_attr(tempfile, 'tempdir', tempdir):
323 tempdir = os.path.join(tempfile.tempdir, 'file')
325 with support.swap_attr(tempfile, 'tempdir', tempdir):
335 _bflags = tempfile._bin_openflags
336 _tflags = tempfile._text_openflags
344 (self.fd, self.name) = tempfile._mkstemp_inner(dir, pre, suf, flags)
355 dir = tempfile.gettempdir()
380 dir = tempfile.mkdtemp()
445 return tempfile._mkstemp_inner(tempfile.gettempdir(),
446 tempfile.template,
448 tempfile._bin_openflags)
468 dir = tempfile.mkdtemp()
483 p = tempfile.gettempprefix()
494 p = tempfile.gettempprefix() + "xxxxxx.xxx"
495 d = tempfile.mkdtemp(prefix="")
516 dir = tempfile.gettempdir()
529 file = tempfile.NamedTemporaryFile()
533 self.failOnException("create file in %s" % tempfile.gettempdir())
537 a = tempfile.gettempdir()
538 b = tempfile.gettempdir()
550 dir = tempfile.gettempdir()
552 (fd, name) = tempfile.mkstemp(dir=dir, prefix=pre, suffix=suf)
577 dir = tempfile.mkdtemp()
590 return tempfile.mkdtemp()
594 dir = tempfile.gettempdir()
596 name = tempfile.mkdtemp(dir=dir, prefix=pre, suffix=suf)
628 dir = tempfile.mkdtemp()
657 file = tempfile.NamedTemporaryFile(delete=False)
660 dir = tempfile.mkdtemp()
668 dir1 = tempfile.mkdtemp()
670 dir2 = tempfile.mkdtemp()
682 self.dir = tempfile.mkdtemp()
691 _bflags = tempfile._bin_openflags
694 self.name = tempfile.mktemp(dir=dir, prefix=pre, suffix=suf)
744 dir = tempfile.gettempdir()
746 file = tempfile.NamedTemporaryFile(dir=dir, prefix=pre, suffix=suf,
765 f = tempfile.NamedTemporaryFile()
771 dir = tempfile.mkdtemp()
773 f = tempfile.NamedTemporaryFile(dir=dir)
783 dir = tempfile.mkdtemp()
786 f = tempfile.NamedTemporaryFile(dir=dir, delete=False)
799 f = tempfile.NamedTemporaryFile()
810 with tempfile.NamedTemporaryFile() as f:
831 self.assertRaises(ValueError, tempfile.NamedTemporaryFile)
838 dir = tempfile.mkdtemp()
841 tempfile.NamedTemporaryFile(mode=(), dir=dir)
853 dir = tempfile.gettempdir()
855 file = tempfile.SpooledTemporaryFile(max_size=max_size, dir=dir, prefix=pre, suffix=suf)
871 dir = tempfile.mkdtemp()
873 f = tempfile.SpooledTemporaryFile(max_size=10, dir=dir)
952 f = tempfile.SpooledTemporaryFile()
964 f = tempfile.SpooledTemporaryFile(max_size=1)
989 f = tempfile.SpooledTemporaryFile(max_size=10)
1010 with tempfile.SpooledTemporaryFile(max_size=1) as f:
1021 with tempfile.SpooledTemporaryFile(max_size=1) as f:
1035 f = tempfile.SpooledTemporaryFile(max_size=1)
1058 tempfile.TemporaryFile()
1064 dir = tempfile.mkdtemp()
1065 f = tempfile.TemporaryFile(dir=dir)
1081 f = tempfile.TemporaryFile()
1093 if tempfile.NamedTemporaryFile is not tempfile.TemporaryFile: