Skip to content

Paths within checksum should be evaluated relative to the checksum file directory, not the current working directory #10

@mattalxndr

Description

@mattalxndr

Changing directories before I verify is not a big deal when using a shell and verifying manually. But if I'm reaching for Python, chances are I'm either verifying a large number of multiple packages, or I'm writing a script to automate.

Either way, it seems like something a library should be handling for me.

Currently, this is required (I'm sure others could do it with less mess):

checksum_path = './relpath/package.md5'
orig = os.currdir
os.chdir(os.path.dirname(checksum_path))
filehash.verify_checksums(os.path.basename(checksum_path))
os.chdir(orig)

If checksums were always evaluated from the directory they're in, I could do this:

checksum_path = './relpath/package.md5'
filehash.verify_checksums(checksum_path)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions