Skip to content
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

Handle some obscure cases #16

Merged
merged 1 commit into from
Dec 30, 2019
Merged

Handle some obscure cases #16

merged 1 commit into from
Dec 30, 2019

Conversation

jayvdb
Copy link
Contributor

@jayvdb jayvdb commented Dec 28, 2019

When the cache path doesnt exist, top-level path
operations fail.

Also prevent open write mode.

Fixes #15
Related to #4

When the cache path doesnt exist, Path operations on the top-level
archive file fail.  Hard-code the expected result to match the
results when the cache is populated.
Add prevent use of `ArchivePath.open` and `ArchiveStream.read`
on the top level archive file.

Also prevent unsupported open write mode.

Fixes dephell#15
Related to dephell#4
# project
from dephell_archive import ArchivePath


sdist_path = Path(__file__).parent / 'requirements' / 'sdist.tar.gz'


def test_toplevel(tmpdir):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy to duplicate these over in test_path_zip, or create a new test file test_path_meta.py/test_path_meta.py for tests which do not depend on the tar/zip implementation.

@orsinium
Copy link
Member

Good catch! I'm going to handle the same when the file is in the cache, and open return its stream. In that case, exists and so on fails on AttributeError ;)

@orsinium orsinium merged commit 6c6675b into dephell:master Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Most operations fail on top level ArchivePath on missing cache
2 participants