X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:message-id:from:to:subject
	:content-type:date; q=dns; s=default; b=OpefLaWBznAttYkiv1i3HPXt
	BwUHjvEX1XosRgmafW+rCLYoFLGwRJUlaHLW0e57vfUtKlmVVJU5vLbmWLdJ5Poh
	mTeRbPtHw08TS42gDj6wW2MX4xqX1VHrajTUc/5lSKr/9VI4sDyKp202Y7UpSeVD
	A3zzmY0rCAnX2pRBJAk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:message-id:from:to:subject
	:content-type:date; s=default; bh=B4PeD0TCTGih2w3QTDDaCRNV+PE=; b=
	V2b7YXTZGvAjincnel0JFpzfcm8uDhCS8s8PxDWEOVFSfJO2VQa3vkSTwUT1fF+6
	GxYrIKq1PxEyz54BVFcKwtYd9fn4Se8SKg2ZjOrZHT2uUbYLSP1OELLx9jCchb+0
	aFjFDm9I+vanpx+toQQaooHluhCdx6Ak6pG2bTzufa4=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.1 required=5.0 tests=BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,XPRIO autolearn=no version=3.3.2 spammy=bye, HImportance:normal, Magic, cookie
X-HELO: mout.gmx.net
MIME-Version: 1.0
Message-ID: <trinity-ec69c9bb-c7c8-4910-b745-c0aa14a3874a-1452547860856@3capp-gmx-bs63>
From: "Holger Bast" <HolgerBast@gmx.de>
To: cygwin@cygwin.com
Subject: cygmagic-1.dll - access violation by accessing the lib via python
Content-Type: text/plain; charset=UTF-8
Date: Mon, 11 Jan 2016 22:31:00 +0100
Sensitivity: Normal
X-UI-Out-Filterresults: notjunk:1;V01:K0:S1ngN21TPek=:jy1PEnOIE2KQ17h6F4om9k IfPIWnWjKzDSQfsxDetRuy99SmbwRVip9ye/T0oJA2gp2YXcidDLsAdNgrNec6v4F3Wz6F8dN tBDfF7SmRIZFIt1hIM3GzefW8tlXkmDZ+3GLTnEhnp4fI0U8ktd7vTYo6+WkKFGFE0gWVxP5t 7e2c6tb8taqoKh1lfVaDewl9VIW2qojXn+Ixxi+Cib7SRQqR8yPXC5aIUdxQDn5qdh3kqvR+h c9a67QNKv7iIHNNKeig1umufmGy9DKBybsucXVyRP58TFzC5vqg0RJjHHFgRgZWzYQiFprWvJ SSxZX5Klqqk2j6GVht+4duBTB+T3Yl1l3fN4k1ACDBBob8BSJWiNG/o6vTEkqEAUFhRhMOokJ ipVIe/8yN93UBO0ALp0G8euRDhkZ6pCfH4l9luDZpeaphJ0OPo/5pmLRO1gRTx1cavsXbPV9r oxqthZ+asw==

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

