cdgriffith / puremagic

Pure python implementation of identifying files based off their magic numbers
MIT License
161 stars 34 forks source link

Resolve issue 26 mimetype from stream #27

Closed robkorv closed 4 years ago

robkorv commented 4 years ago

closes #26

robkorv commented 4 years ago

@cdgriffith is there something I must do to make the test succeed? It's failing on No such file or directory: 'box'.

cdgriffith commented 4 years ago

Looks like I left a bad carryover in the workflow https://github.com/cdgriffith/puremagic/blob/master/.github/workflows/tests.yml#L35

Needs to be changed from box to puremagic

robkorv commented 4 years ago

Looks like I left a bad carryover in the workflow https://github.com/cdgriffith/puremagic/blob/master/.github/workflows/tests.yml#L35

Needs to be changed from box to puremagic

Can I do this myself or do you have a fix somewhere I should cherry-pick?

cdgriffith commented 4 years ago

Should be able to change it in your branch just fine .github/workflows/tests.yaml

robkorv commented 4 years ago

failing on:

puremagic/main.py:284:13: T001 print found.
            print("File '{0}' does not exist!".format(fn))
            ^
puremagic/main.py:287:13: T001 print found.
            print("'{0}' : {1}".format(fn, from_file(fn, args.mime)))
            ^
puremagic/main.py:289:13: T001 print found.
            print("'{0}' : could not be Identified".format(fn))
            ^
3     T001 print found.

Which is not something I diffed. Is this something that must be forced? I think the general stance is that printing for cli is ok-ish. Else this should be a in a logger and the PureError except msg in a sys.exit() so the terminal also receives an error signal.

cdgriffith commented 4 years ago

Yeah I think the workflow was just copped over and somehow not tested. I will fix that separately.