Registry / testing / tempdir

tempdir

JSON →
library0.7.1pypypi✓ verified 84d ago

A simple library providing temporary directory contexts, wrapping tempfile.mkdtemp. Current version 0.7.1, low activity.

pip install tempdir
INSTALL
IMPORT
SIG · TEMPDIR
T
tempdir
testingpythonv0.7.1
Install
2.4s avg
Import
11ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.4s · import 0.010s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TempDir
from tempdir import TempDir
correct import

Create and automatically clean up a temporary directory using TempDir context manager.

import os from tempdir import TempDir with TempDir() as td: td.write('test.txt', 'hello') assert os.path.isdir(td.name) assert not os.path.exists(td.name)
Debug
Known issues
gotchaTempDir creates a new directory each time; the directory is not reused. Do not rely on the path being predictable.
fix
Use the returned TempDir object's .name attribute for the path.
affects: all
gotchaTempDir does not set permissions; directory permissions are inherited from umask. Might be world-readable if umask is permissive.
fix
Set umask or adjust permissions manually after creation if security is a concern.
affects: all
deprecatedThe library is no longer actively maintained. Consider using tempfile.TemporaryDirectory from the standard library instead.
fix
Replace with: from tempfile import TemporaryDirectory
affects: >=0.7.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tempdir'
tempdir not installed or environment issue
fix
pip install tempdir
AttributeError: module 'tempdir' has no attribute 'TempDir'
Wrong import: import tempdir then using tempdir.TempDir
fix
Use: from tempdir import TempDir
tempdir.TempDir is deprecated
tempdir library not standard library; standard library's tempfile has TemporaryDirectory
fix
Use: from tempfile import TemporaryDirectory
Upgrade
Version history
0.7.1latest on PyPI · released Mar 2, 2016
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
tempdir — pip install tempdir · libregistry