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

Add a way to specify a default for magic_file. #305

Closed
maringuu opened this issue Oct 12, 2023 · 1 comment
Closed

Add a way to specify a default for magic_file. #305

maringuu opened this issue Oct 12, 2023 · 1 comment

Comments

@maringuu
Copy link
Contributor

maringuu commented Oct 12, 2023

My use case it the following:
We have some additional magic that we want to always use in our project.
So one idea would be to create an instance of Magic with the appropriate magic_file.
But now when we want to specify mime=True or follow_symlinks=True we need to create a new instance of Magic.
I guess one could say that all other arguments than magic_file are of a more short-lived nature.

This leads to some boilerplate which I think belongs in python-magic instead.

My proposal would be to add some way to set a default value for magic_file.
While I know that this is the way libmagic is designed I think we can to better in a wrapper library.

Related:
#304
fkie-cad/FACT_core#1140

@ahupp
Copy link
Owner

ahupp commented Oct 13, 2023

See my comment on your PR, but I'd support adding an environment variable that sets the default magic file.

@maringuu maringuu closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants