On this page
shutil.unregister_archive_format
Prev: shutil.unpack_archive | Up: shutil | Next: shutil.unregister_unpack_format
Rel: shutil.chown, shutil.copy, shutil.copy2, shutil.copyfile
Ref: docs.python.org — shutil.unregister_archive_format
Tags: #public #python3 #stdlib #shutil
Import
import shutil
from shutil import unregister_archive_format
Signature & Overview
shutil.unregister_archive_format(name)
shutil.unregister_archive_format() function.
Usage
import shutil
shutil.register_archive_format("demo_fmt", lambda base, root, **kw: f"{base}.demo")
shutil.unregister_archive_format("demo_fmt")
assert "demo_fmt" not in dict(shutil.get_archive_formats())
Gotchas
- Removes a format from the global registry: Pair with
register_archive_format()intry ... finally:blocks to keep tests isolated (unknown names raiseKeyErroron some Python versions).
REPL Inspect
from shutil import unregister_archive_format
help(unregister_archive_format)
Linked from
Related notes
- tuts/python3/stdlib_module/shutil/unpack_archive Linked here; links to this page; shared tags: #shutil, #stdlib
- tuts/python3/stdlib_module/shutil/unregister_unpack_format Linked here; links to this page; shared tags: #shutil, #stdlib
- tuts/python3/stdlib_module/shutil Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/shutil/chown Linked here; shared tags: #shutil, #stdlib
- tuts/python3/stdlib_module/shutil/copy Linked here; shared tags: #shutil, #stdlib
- tuts/python3/stdlib_module/shutil/copy2 Linked here; shared tags: #shutil, #stdlib
- tuts/python3/stdlib_module/shutil/copyfile Linked here; shared tags: #shutil, #stdlib
- tuts/python3/stdlib_module/shutil/copyfileobj shared tags: #shutil, #stdlib
- tuts/python3/stdlib_module/shutil/copymode shared tags: #shutil, #stdlib
- tuts/python3/stdlib_module/shutil/copystat shared tags: #shutil, #stdlib