<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/python-magic.git/magic.py, branch master</title>
<subtitle>github.com: ahupp/python-magic.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/'/>
<entry>
<title>Convert to a package so we can add more files</title>
<updated>2017-12-04T07:04:32+00:00</updated>
<author>
<name>Adam Hupp</name>
<email>adam@hupp.org</email>
</author>
<published>2017-12-04T07:04:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=9ae12462c15100941435acf4eb9caaf5de5dddf9'/>
<id>9ae12462c15100941435acf4eb9caaf5de5dddf9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Added support for magic_descriptor routine</title>
<updated>2020-12-07T15:08:12+00:00</updated>
<author>
<name>psrok1</name>
<email>pawel.srokosz@cert.pl</email>
</author>
<published>2020-12-07T15:04:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=ca14bfba7d1eeea543c9e00ea33d1487a49e68e0'/>
<id>ca14bfba7d1eeea543c9e00ea33d1487a49e68e0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>complete comment</title>
<updated>2020-11-06T19:21:16+00:00</updated>
<author>
<name>Adam Hupp</name>
<email>adam@hupp.org</email>
</author>
<published>2020-11-06T19:21:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=35026a19d6ff2b1934999ec6fb9c1812e4d4b07e'/>
<id>35026a19d6ff2b1934999ec6fb9c1812e4d4b07e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle undecodable characters in description</title>
<updated>2020-11-06T18:43:39+00:00</updated>
<author>
<name>Adam Hupp</name>
<email>adam@hupp.org</email>
</author>
<published>2020-11-06T18:43:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=a74c994b704d3476e2054cc6332c0a4c49ea1c69'/>
<id>a74c994b704d3476e2054cc6332c0a4c49ea1c69</id>
<content type='text'>
We've historically expected that the return values from libmagic are
ascii, since they are constant strings or stuff like dates/numbers.
In some cases, however, it will return information like the title of
the document in the doc's native character set, which is unknown to
us.  This produces decode errors.

I have not been able to get a document that triggers this behavior,
but the safest change is to decode with 'backslashreplace', which
escapes undecodable characters with a backslash.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We've historically expected that the return values from libmagic are
ascii, since they are constant strings or stuff like dates/numbers.
In some cases, however, it will return information like the title of
the document in the doc's native character set, which is unknown to
us.  This produces decode errors.

I have not been able to get a document that triggers this behavior,
but the safest change is to decode with 'backslashreplace', which
escapes undecodable characters with a backslash.
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle libmagic versions that don't support MAGIC_EXTENSION</title>
<updated>2020-11-06T18:39:10+00:00</updated>
<author>
<name>Adam Hupp</name>
<email>adam@hupp.org</email>
</author>
<published>2020-11-06T18:39:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=77b8cbea6ceffecb4cbc471d1e8fa22843389439'/>
<id>77b8cbea6ceffecb4cbc471d1e8fa22843389439</id>
<content type='text'>
extension support was added to libmagic in 2015 in
9190a18d09f25fb0ca6abe1fcbdba780f5077e45.  This change:

 - updates the test to handle various verions that return garbage /
   empty string.s
- throws an exception in magic.Magic if extension support is requested
  and we know its not supported.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
extension support was added to libmagic in 2015 in
9190a18d09f25fb0ca6abe1fcbdba780f5077e45.  This change:

 - updates the test to handle various verions that return garbage /
   empty string.s
- throws an exception in magic.Magic if extension support is requested
  and we know its not supported.
</pre>
</div>
</content>
</entry>
<entry>
<title>MAGIC_EXTENSION support (file --extension)</title>
<updated>2020-10-22T15:20:57+00:00</updated>
<author>
<name>darkbarker</name>
<email>barkdarker@gmail.com</email>
</author>
<published>2020-10-21T17:33:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=800946dee24a4ef94d4f2f604bc4e9557561c58e'/>
<id>800946dee24a4ef94d4f2f604bc4e9557561c58e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fallback to default behavior on setparam failure</title>
<updated>2020-08-13T21:56:54+00:00</updated>
<author>
<name>Adam Hupp</name>
<email>adam@hupp.org</email>
</author>
<published>2020-08-13T21:56:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=1b6cede2550784251296496ad65ece8266e56250'/>
<id>1b6cede2550784251296496ad65ece8266e56250</id>
<content type='text'>
Some versions of libmagic (unclear which) fail the setparam call in
the Magic constructor.  This this is just resolving a corner case to
begin with, silently continue on if this happens.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some versions of libmagic (unclear which) fail the setparam call in
the Magic constructor.  This this is just resolving a corner case to
begin with, silently continue on if this happens.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix bug in Magic when destructor called too early</title>
<updated>2020-08-13T21:34:52+00:00</updated>
<author>
<name>Ofer Koren</name>
<email>koreno@gmail.com</email>
</author>
<published>2020-08-13T21:34:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=16972c2c6fda3573860f5f8b0f2c03b757e71d3c'/>
<id>16972c2c6fda3573860f5f8b0f2c03b757e71d3c</id>
<content type='text'>
Potentially `magic_open` may fail, and when python attempts to gc the Magic instance it fails with:
```
Exception ignored in: &lt;function Magic.__del__ at 0x7f595ba06430&gt;
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/magic.py", line 129, in __del__
    if self.cookie and magic_close:
AttributeError: 'Magic' object has no attribute 'cookie'
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Potentially `magic_open` may fail, and when python attempts to gc the Magic instance it fails with:
```
Exception ignored in: &lt;function Magic.__del__ at 0x7f595ba06430&gt;
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/magic.py", line 129, in __del__
    if self.cookie and magic_close:
AttributeError: 'Magic' object has no attribute 'cookie'
```</pre>
</div>
</content>
</entry>
<entry>
<title>Make magic_[version|setparam|getparam] optional</title>
<updated>2020-05-06T02:23:19+00:00</updated>
<author>
<name>Adam Hupp</name>
<email>adam@hupp.org</email>
</author>
<published>2020-05-06T02:23:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=06258071f511db9d28960fb3613d624147ec5151'/>
<id>06258071f511db9d28960fb3613d624147ec5151</id>
<content type='text'>
These aren't present in ancient versions of libmagic, so only fetch
optionally and throw NotImplementedError if called.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These aren't present in ancient versions of libmagic, so only fetch
optionally and throw NotImplementedError if called.
</pre>
</div>
</content>
</entry>
<entry>
<title>Partial fix for PR #70</title>
<updated>2020-05-05T20:54:33+00:00</updated>
<author>
<name>Adam Hupp</name>
<email>adam@hupp.org</email>
</author>
<published>2020-05-05T20:53:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/python-magic.git/commit/?id=bc53bc5cc537c29ab9e66b204543a02b865f6ee3'/>
<id>bc53bc5cc537c29ab9e66b204543a02b865f6ee3</id>
<content type='text'>
Not going to change the value of MAGIC_MIME until a major version
bump, but at least add the missing MAGIC_MIME_TYPE constant and use
where it should be.

https://github.com/ahupp/python-magic/pull/70
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Not going to change the value of MAGIC_MIME until a major version
bump, but at least add the missing MAGIC_MIME_TYPE constant and use
where it should be.

https://github.com/ahupp/python-magic/pull/70
</pre>
</div>
</content>
</entry>
</feed>
