public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Holger Bast" <HolgerBast@gmx.de>
To: cygwin@cygwin.com
Subject: cygmagic-1.dll - access violation by accessing the lib via python
Date: Mon, 11 Jan 2016 22:58:00 -0000	[thread overview]
Message-ID: <trinity-ec69c9bb-c7c8-4910-b745-c0aa14a3874a-1452547860856@3capp-gmx-bs63> (raw)

Hi there,
I'm using a python wrapper (python-magic, https://github.com/ahupp/python-magic) checking some filetypes in a small script. The wrapper works fine under Unix-like system, but I got an access violation error under cygwin. I already tried an older version of file including libmagic from the gnuwin32-project and this one works fine - aside it's completely outdated ;)
This issue was already identified on the issue tracker of the python-wrapper but I don't think that this error is a problem of the wrapper  (see https://github.com/ahupp/python-magic/issues/76). I found some python wrappers on the cygwin mirrors (python-magic-5.24-1.tar.xz) but these also produce the same error.

Ok, here the script I used:

requirements: python 2.7 and python-magic

import magic

mage = magic.Magic(mime=True)
filetype = mage.from_file("testfile.odt")
print filetype


Output:

Traceback (most recent call last):
  File "C:/Users/aronadaal/PycharmProjects/libmagic-test/magictest.py", line 3, in <module>
    mage = magic.Magic(mime=True)
  File "C:\Python27\lib\site-packages\magic.py", line 59, in __init__
    self.cookie = magic_open(self.flags)
WindowsError: exception: access violation writing 0x0000000000000000
Exception AttributeError: "Magic instance has no attribute 'cookie'" in <bound method Magic.__del__ of <magic.Magic instance at 0x00000000022CEA48>> ignored

Notice: You can ignore the last message regarding the "cookie"-variable. The filehhandler is stored inside it during the initialization. That's ok.

Bye, aronadaal

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

             reply	other threads:[~2016-01-11 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-11 22:58 Holger Bast [this message]
2016-01-12  9:55 ` Corinna Vinschen
2016-01-12 15:05   ` Holger Bast
2016-01-12 15:39     ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-ec69c9bb-c7c8-4910-b745-c0aa14a3874a-1452547860856@3capp-gmx-bs63 \
    --to=holgerbast@gmx.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).