Skip to content

Toolify #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog

In Development
==============
* Allow for stripping/removing comments (needed by certain tools which
bundle python-archive)
* Use relative import to allow module relocation.
* Moved tests outside of the archive package directory.


Expand Down
5 changes: 4 additions & 1 deletion archive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@
import tarfile
import zipfile

from archive.compat import IS_PY2, is_string
from .compat import IS_PY2, is_string


class ArchiveException(Exception):
"""Base exception class for all archive errors."""
pass


class UnrecognizedArchiveFormat(ArchiveException):
"""Error raised when passed file is not a recognized archive format."""
pass


class UnsafeArchive(ArchiveException):
"""
Error raised when passed file contains paths that would be extracted
outside of the target directory.
"""
pass


def extract(path, to_path='', ext='', **kwargs):
Expand Down