Python Glossary Русский

all Python 3Exceptionsexception

shutil.RegistryError

module exceptions

Raised when a registry operation with the archiving and unpacking registries fails

Syntax

raise shutil.RegistryError

In practice the only source is register_unpack_format with an extension another unpacker has already claimed (.zip, .tar, .tar.gz and friends are taken out of the box). Unlike the rest of shutil's errors it inherits straight from Exception rather than OSError, so an except OSError clause will let it through. A misspelled format name passed to make_archive or unpack_archive raises ValueError instead.

Examples

import shutil
try:
    raise shutil.RegistryError
except shutil.RegistryError as e:
    print(type(e).__name__)   # → RegistryError

See also

Open in the full glossarydocs.python.orgReport an inaccuracy