summaryrefslogtreecommitdiff
path: root/magic.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #144 from nicfit/masterAdam Hupp2017-11-201-1/+1
|\ | | | | Handle incorrectly encoded file names
| * Handle incorrectly encoded files (i.e. does not match file systemTravis Shirk2017-09-261-1/+1
| | | | | | | | encoding)
* | python3 str handlingAdam Hupp2017-11-201-0/+5
|/ | | | | | | In python3 ctypes, a str is passed to ctypes as wchar*. This means the layout of the string magic looks like [ascii, null, ascii, null, etc]. For some reason, magic handles this just fine most of the time, but it's clearly wrong and I'm amazed it worked at all.
* Accommodate linux distros that return trailing version, i.e. AlpineMark Beacom2017-02-241-1/+2
|
* Fixed type for DLL search on Linux platformArtem Skoretskiy2017-01-051-1/+1
| | | Provide correct list of strings instead of string
* Added a fallback for Alpine to find library fileArtem Skoretskiy2016-12-211-1/+3
| | | | There are some Linuxes that have libraries search broken. This commit would add a reasonable fallback for these systems. Otherwise python-magic does not work there having "magic" library installed and python-magic from Pypi.
* Handling 'mime' and 'mime_encoding' independentlySergeySatskiy2016-11-221-1/+1
|
* Return str rather than bytes for the description strings on python3.Adam Hupp2016-06-051-2/+10
| | | | | Assumes utf-8 encoding from magic return values, which I hope is always the case.
* propagate exception in other branch of 509 hackAdam Hupp2016-06-051-1/+3
|
* throw proper exception on each python version0.4.11Adam Hupp2016-03-201-6/+3
|
* Fix MagicExceptionRaphaël Vinot2015-11-061-1/+6
| | | | self.message was missing, causing `_handle509Bug` to fail.
* remove spurious newlinesAdam Hupp2015-10-191-19/+0
|
* Replace per-thread Magic instance with a lock. Tested with a stressAdam Hupp2015-10-191-24/+15
| | | | | | stest that runs a 100 from_file checks on a 100 threads, concurrently. This almost immediately causes a SEVG without the lock, and runs successfully with the lock.
* Fixed 'ImportError: failed to find libmagic. Check your installation' when ↵Eugene Susla2014-11-281-1/+3
| | | | using cygwin's python
* Add support for MAGIC_COMPRESS through Magic constructor.Zach Seils2014-11-101-3/+7
|
* Always use utf-8 regardless of filesystem encodingAdam Hupp2014-05-301-3/+4
|
* Merge pull request #59 from brutasse/fix/py3Adam Hupp2014-04-271-2/+2
|\ | | | | PyPI classifiers, 2.6 compatibility
| * Workaround sys.version_info not being a named tuple on py26Bruno Renié2014-03-041-2/+2
| |
* | find library in windows if cygwin path is added to PATHFedor Baart2014-02-251-1/+1
|/
* remove extra import sysasl972014-01-281-1/+0
|
* Properly handle unicode filenames given in both byte-str and unicodeAdam Hupp2014-01-041-1/+12
| | | | values, across both python 3 and 2.
* Replace windows docs with cygwin instructions/pathAdam Hupp2014-01-041-3/+3
|
* Fixed issue with flagsMichael Jarvis2013-10-241-7/+7
|
* Hypothetical fix for issue https://github.com/ahupp/python-magic/issues/47Adam Hupp2013-10-231-3/+15
|
* Fix failure on file-5.15. That has a bug and/or change in behviorAdam Hupp2013-10-071-7/+14
| | | | | | | where the first call to magic_load results in magic_error returning a string even though there was no error. Fixed by being more precise about checking the return values (either nul or -1 depending on function) rather than relying on magic_error.
* Don't hard-code version number when finding homebrew libraryAdam Hupp2013-09-271-2/+5
|
* Merge branch 'master' of https://github.com/aromanovich/python-magic into ↵Adam Hupp2013-09-271-2/+5
|\ | | | | | | | | | | | | aromanovich-master Conflicts: test.py
| * Add keep going functionalityAnton Romanovich2013-02-051-2/+5
| |
* | Use python 2.4-compatible threading.currentThread() callAdam Hupp2013-09-271-2/+2
| |
* | Add some commentsAdam Hupp2013-06-031-1/+26
| |
* | - avoid segfault when used in multiple threads via ↵Adam Hupp2013-06-021-18/+16
|/ | | | | | magic.from_buffer/from_file methods - add hard check to prevent this in the future (possibly breaking change)
* Support python 3Adam Hupp2012-11-011-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | - various unicode/bytes test fixes - resolve an (undocumented?) change in how ctypes converts unicode strings to char string by always using the default filesystem encoding. Test Plan: adam@gaba:~/github/python-magic$ python test.py ..... ---------------------------------------------------------------------- Ran 5 tests in 0.010s OK adam@gaba:~/github/python-magic$ python3 test.py ..... ---------------------------------------------------------------------- Ran 5 tests in 0.016s OK adam@gaba:~/github/python-magic$ ~/opt/python3.3/bin/python3 test.py .. snip ... ---------------------------------------------------------------------- Ran 5 tests in 0.025s
* explain change to __del__Adam Hupp2012-09-171-0/+1
|
* Check for magic_close as well. When python is exiting it can beAndre Cruz2012-07-251-1/+1
| | | | None already.
* Added path to default homebrew install of libmagic on Mac OS XLeah Xue2012-05-211-6/+7
|
* Fix dylib look with patch from sacha@ssl.co.ukAdam Hupp2011-12-291-4/+5
|
* Remove absolute path for libmagic.dylib on darwin to allow for other types ↵Adam Hupp2011-12-291-2/+2
| | | | of install
* Consolidate darwin/win32 library loading. Tested on OSX.Adam Hupp2010-11-211-12/+5
|
* Merge branch 'master' of https://github.com/FlaPer87/python-magic into ↵Adam Hupp2010-11-211-9/+26
|\ | | | | | | FlaPer87-master
| * Commet error fix. I was hungryFlavio Percoco Premoli2010-09-301-5/+5
| |
| * Some load improvementsFlavio Percoco Premoli2010-09-301-6/+23
| |
* | reorder Mime args to preserve compatabilityAdam Hupp2010-11-211-1/+1
| |
* | Add new feature which return mime_encoding of file.Nicolas Delaby2010-10-151-2/+7
|/
* avoid abort if you somehow double freeAdam Hupp2010-04-171-1/+3
|
* Added win32 compatibilitymaze2010-04-021-2/+5
|
* remove unnessary handler in _del_Adam Hupp2010-03-311-5/+1
|
* - Grab fix for OSX from bitbucket.org/pfw/Adam Hupp2010-03-311-0/+7
| | | | - Produce a more sensible error message when no library is found
* initial commitAdam Hupp2010-03-311-0/+207