delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/01/12/04:49:03

X-Recipient: archive-cygwin AT delorie DOT 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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=Kx1xdXb5Migcvk5pSdSM02dgpKLXIP2a+iB0LX7EgsyVVcGZVj0UV
/LOuAmK+RBWMCKia/XzCtrHYUXsvOWRB+G6ZH5pDP/bNYfa6bbIsXGS5VwwV5oMD
nWcC+7u7Md+BjYRjdf1e75GOzP0oTUJssL0pe5dCfPUe5SFPC4UL1g=
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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=V8eCMA9qZdb6wH84NqqWrJ07euc=; b=Sum+IsAPFApYHrLSaNVxx02Jqo5I
HYra1GAWtYiSdqywOPfH+JRCLmBZUTJLhiLhnGbhWIC60DlxQu8HsFM5QBE4WEOq
DAeo8m6QJHsFdV0Zxq/zlP4qaqzl/4AiVsWnP+55e6PKbZlR11qkLPqiw5/6yQSY
a9KUWUWlFlPN0EE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-92.7 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,KHOP_DYNAMIC,RCVD_IN_BRBL_LASTEXT,RCVD_IN_PBL,RDNS_DYNAMIC,USER_IN_WHITELIST autolearn=no version=3.3.2 spammy=violation, Magic, filetype, sk:gnuwin3
X-HELO: calimero.vinschen.de
Date: Tue, 12 Jan 2016 10:48:43 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygmagic-1.dll - access violation by accessing the lib via python
Message-ID: <20160112094843.GB15034@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <trinity-ec69c9bb-c7c8-4910-b745-c0aa14a3874a-1452547860856 AT 3capp-gmx-bs63>
MIME-Version: 1.0
In-Reply-To: <trinity-ec69c9bb-c7c8-4910-b745-c0aa14a3874a-1452547860856@3capp-gmx-bs63>
User-Agent: Mutt/1.5.24 (2015-08-30)

--mxv5cy4qt+RJ9ypb
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Holger,

On Jan 11 22:31, Holger Bast wrote:
> 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.

This sounds weird.  Are you using Cygwin's python or some native Windows
python?  In the latter case, you can't use Cygwin DLLs from your
non-Cygwin python.  It won't work as desired and it's not supported.

As for your Cygwin installation, we need the output of `cygcheck -svr'
per http://cygwin.com/problems.html

> Ok, here the script I used:
>=20
> requirements: python 2.7 and python-magic
>=20
> import magic
>=20
> mage =3D magic.Magic(mime=3DTrue)
> filetype =3D mage.from_file("testfile.odt")
> print filetype

I'm python illiterate but as Cygwin file maintainer I tried this myself.
The packages file-5.24-1, file-devel-5.24-1, python-magic-5.24-1, and
python-2.7.10-1 are installed.

> Output:

In my case:

  $ python2.7 magic.py
  Traceback (most recent call last):
    File "magic.py", line 1, in <module>
      import magic
    File "/home/corinna/magic.py", line 3, in <module>
      mage =3D magic.Magic(mime=3DTrue)
  AttributeError: 'module' object has no attribute 'Magic'

What am I doing wrong?

Anyway, I uploaded the latest file 5.25 a few minutes ago.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--mxv5cy4qt+RJ9ypb
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWlMv7AAoJEPU2Bp2uRE+gWUIP/j+DXojFxmaFzMdMDJP3JZif
4F80SWDArTOmNuMjO+sUDT+pXGVmt7hRibmmjVT2cG4DK92KlQbgXqKpKJFBwuam
nj6rN8w59JC7jp9+9IutBgGmYjg0TnzYSg29UPhU1BIKKlX570MhnQvFR6ll70/h
7di0bcw3MsfSuyCFilpwamNrHwF3ogs13PP4wysqI0MqkkN/87fxJcgfjLYmA6pL
9iToKbvAdfrbOgwNs78MXRsNGKJd60kXAvVGGMRBDK2Scyz/AjOLGg8LC68mQhtx
/45nAQ3QSk0tspAlTfc/+lOlqWnEWvK0PlaDOX3mkqv/PkY75RXIc1/QPw9f+Ds3
wZ27iyfeUlN7bTEOSg01hFmP34RFIAkSahiYb1yuDl4ld35yMO5nrjs13gLBpmny
vnZyV/j22IQfbF9tx3WBAe5FJz98cJu/WGrgZ/Md9xj7wqVTwYB2PwrH2ZyEK3jn
uAj44BJWgH+xoP7eDKbBu0+s/ly3IhbEAyJX5SH4VshuihuNl846KNcPMOqF98cL
toil9Us/Ugj7MIQFyIPRguBUZZ2HHHBsujl0AoIVCI/TJuEL7OVjLaopyTfEXc5m
jOTr0tnL1jXZ/oUOtdhMEkA8Vlw99GunSft+Se2ASNoxY41lr81Bv6XwfPBcqMBS
a5GGhdoha7uygL0AR8Kb
=V7NN
-----END PGP SIGNATURE-----

--mxv5cy4qt+RJ9ypb--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019