ahupp / ahupp/python-magic

Error on setparam in 0.4.1[78]

Open
#213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
304
PR merge metrics
No merged PRs in 30d

Description

@mbarakaja reports:

I am not sure if this is related but my build started failing with this new version

h_inventory/fetch.py:131: in _validate
mimetype = magic.from_buffer(response.content, mime=True)
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/magic.py:165: in from_buffer
m = _get_magic_type(mime)
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/magic.py:139: in _get_magic_type
i = _instances[mime] = Magic(mime=mime)
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/magic.py:76: in init
self.setparam(MAGIC_PARAM_NAME_MAX, 64)
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/magic.py:113: in setparam
return magic_setparam(self.cookie, param, val)
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/magic.py:322: in magic_setparam
return _magic_setparam(cookie, param, byref(v))
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/magic.py:217: in errorcheck_negative_one
raise MagicException(err)
E MagicException: None

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the traceback in h_inventory/fetch.py:131, then inspect magic.py around _get_magic_type, Magic.init, setparam, and magic_setparam. Reproduce the failing call shown in the report and determine why MAGIC_PARAM_NAME_MAX raises MagicException: None; done means the reported setparam path completes without that exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.