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()
174 cand = tempfile._candidate_tempdir_list()
190 cand = tempfile._candidate_tempdir_list()
216 our_temp_directory = tempfile.mkdtemp()
222 with support.swap_attr(tempfile, "_candidate_tempdir_list",
225 tempfile._get_default_tempdir()
234 tempfile._get_default_tempdir()
247 tempfile._get_default_tempdir()
261 obj = tempfile._get_candidate_names()
262 self.assertIsInstance(obj, tempfile._RandomNameSequence)
266 a = tempfile._get_candidate_names()
267 b = tempfile._get_candidate_names()
276 dir = tempfile.mkdtemp()
278 with support.swap_attr(tempfile, 'tempdir', dir):
285 return support.swap_attr(tempfile,
294 oldmode = mode = os.stat(tempfile.tempdir).st_mode
296 os.chmod(tempfile.tempdir, mode)
298 if os.access(tempfile.tempdir, os.W_OK):
303 self.assertEqual(os.listdir(tempfile.tempdir), [])
305 os.chmod(tempfile.tempdir, oldmode)
309 tempdir = os.path.join(tempfile.tempdir, 'nonexistent')
310 with support.swap_attr(tempfile, 'tempdir', tempdir):
317 tempdir = os.path.join(tempfile.tempdir, 'file')
319 with support.swap_attr(tempfile, 'tempdir', tempdir):
329 _bflags = tempfile._bin_openflags
330 _tflags = tempfile._text_openflags
338 (self.fd, self.name) = tempfile._mkstemp_inner(dir, pre, suf, flags)
349 dir = tempfile.gettempdir()
374 dir = tempfile.mkdtemp()
439 return tempfile._mkstemp_inner(tempfile.gettempdir(),
440 tempfile.template,
442 tempfile._bin_openflags)
462 dir = tempfile.mkdtemp()
477 p = tempfile.gettempprefix()
488 p = tempfile.gettempprefix() + "xxxxxx.xxx"
489 d = tempfile.mkdtemp(prefix="")
510 dir = tempfile.gettempdir()
523 file = tempfile.NamedTemporaryFile()
527 self.failOnException("create file in %s" % tempfile.gettempdir())
531 a = tempfile.gettempdir()
532 b = tempfile.gettempdir()
544 dir = tempfile.gettempdir()
546 (fd, name) = tempfile.mkstemp(dir=dir, prefix=pre, suffix=suf)
571 dir = tempfile.mkdtemp()
584 return tempfile.mkdtemp()
588 dir = tempfile.gettempdir()
590 name = tempfile.mkdtemp(dir=dir, prefix=pre, suffix=suf)
622 dir = tempfile.mkdtemp()
651 file = tempfile.NamedTemporaryFile(delete=False)
654 dir = tempfile.mkdtemp()
662 dir1 = tempfile.mkdtemp()
664 dir2 = tempfile.mkdtemp()
676 self.dir = tempfile.mkdtemp()
685 _bflags = tempfile._bin_openflags
688 self.name = tempfile.mktemp(dir=dir, prefix=pre, suffix=suf)
738 dir = tempfile.gettempdir()
740 file = tempfile.NamedTemporaryFile(dir=dir, prefix=pre, suffix=suf,
759 f = tempfile.NamedTemporaryFile()
765 dir = tempfile.mkdtemp()
767 f = tempfile.NamedTemporaryFile(dir=dir)
777 dir = tempfile.mkdtemp()
780 f = tempfile.NamedTemporaryFile(dir=dir, delete=False)
793 f = tempfile.NamedTemporaryFile()
804 with tempfile.NamedTemporaryFile() as f:
824 self.assertRaises(ValueError, tempfile.NamedTemporaryFile)
831 dir = tempfile.mkdtemp()
834 tempfile.NamedTemporaryFile(mode=(), dir=dir)
846 dir = tempfile.gettempdir()
848 file = tempfile.SpooledTemporaryFile(max_size=max_size, dir=dir, prefix=pre, suffix=suf)
864 dir = tempfile.mkdtemp()
866 f = tempfile.SpooledTemporaryFile(max_size=10, dir=dir)
945 f = tempfile.SpooledTemporaryFile()
957 f = tempfile.SpooledTemporaryFile(max_size=1)
982 f = tempfile.SpooledTemporaryFile(max_size=10)
1003 with tempfile.SpooledTemporaryFile(max_size=1) as f:
1014 with tempfile.SpooledTemporaryFile(max_size=1) as f:
1028 f = tempfile.SpooledTemporaryFile(max_size=1)
1051 tempfile.TemporaryFile()
1057 dir = tempfile.mkdtemp()
1058 f = tempfile.TemporaryFile(dir=dir)
1074 f = tempfile.TemporaryFile()
1086 if tempfile.NamedTemporaryFile is not tempfile.TemporaryFile: