Skip to content

pass the magic-file parameter around the module functions#56

Closed
jbremer wants to merge 1 commit intoahupp:masterfrom
jbremer:master
Closed

pass the magic-file parameter around the module functions#56
jbremer wants to merge 1 commit intoahupp:masterfrom
jbremer:master

Conversation

@jbremer
Copy link
Copy Markdown

@jbremer jbremer commented Feb 15, 2014

No description provided.

@ahupp
Copy link
Copy Markdown
Owner

ahupp commented Apr 30, 2014

Since from_buffer/from_file memoize their result, this is going to produce inconsistent results if you switch the file mid-execution. I'd prefer that this get solved either by globally overriding the file (there's an env var IIRC though I don't remember it off the top of my head), or by using the Magic class directly.

@ahupp ahupp closed this Apr 30, 2014
@jbremer
Copy link
Copy Markdown
Author

jbremer commented May 4, 2014

I was using the Magic class directly before, but it gives problems when you use it from different threads, which is something the module functions do in fact handle correctly.
Using the environment doesn't really sound like a very good option to me - when working from within Python.

Let me know if you care to reconsider this PR, otherwise I guess it's also fine ;-)

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

Successfully merging this pull request may close these issues.

2 participants