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=GOJclwwyJ8LOuec+V2eMNjUUTLE4YZaZtdkpy/qw0wuFKsViIiVcY /5Y86jGuutVJqMiLtT06p7eaJTlPg6pNuisrRVBMHmYFixD6g1v6BTBYosghQW1O FuRqmZRui50sDMo+MFTPkoCr92turEjCon2F2V+LBBp/FeMN/R0Zt4= 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=GvxZuzxcseYOQEu3WjannBFMWXA=; b=WQowQOT0D8K97K9H31nMzLO4IvtG NJgKEgQzZc2tf7VlLLmEzEK4I2gdSKOppdScUvEpjYVy59z+XmNVJYPI5+4JXAvq Ac4hJ4+kQIuSqUmMZYudmzg0UirnL2DxgA8cJS1FDwRWfMzqL8rZTgIfpQJCI1sh /dX5/R7TFkFXmBk= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=-96.2 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=ham version=3.3.2 spammy= X-HELO: calimero.vinschen.de Date: Thu, 30 Jun 2016 16:34:39 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Change in behavior (bug) in ctypes Message-ID: <20160630143439.GS981@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <57752727 DOT 9070706 AT gmail DOT com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vk/v8fjDPiDepTtA" Content-Disposition: inline In-Reply-To: <57752727.9070706@gmail.com> User-Agent: Mutt/1.6.1 (2016-04-27) --vk/v8fjDPiDepTtA Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 30 10:05, Marvin Greenberg wrote: > Code like this was working until sometime recently, >=20 > $ python > >>> import ctypes > >>> cygdll =3D ctypes.cdll.cygwin1 >=20 > But with the latest cygwin update, it is failing. On a couple older > machines, I do: >=20 >=20 > $ python -c "import ctypes; print ctypes._dlopen('cygwin1')"; cygcheck -V; > python -V > 6442713088 > cygcheck (cygwin) 2.1.0 > System Checker for Cygwin ... > Python 2.7.10 >=20 > $ python -c "import ctypes; print ctypes._dlopen('cygwin1')"; cygcheck -= V; > python -V > 6442713088 > cygcheck (cygwin) 2.5.1 > System Checker for Cygwin ... > Python 2.7.10 >=20 > This last was on a windows 8.1 (Windows 8.1 Enterprise Ver 6.3 Build 9600) > system. I updated cygwin completely on that system to cygwin latest from= a > mirror. And, then >=20 > $ python -c "import ctypes; print ctypes._dlopen('cygwin1')"; cygcheck -= V; > python -V > Traceback (most recent call last): > File "", line 1, in > OSError: No such file or directory > cygcheck (cygwin) 2.5.2 > System Checker for Cygwin ... > Python 2.7.10 >=20 > Note that simply changing the call to explicitly append the dll extension > works fine: >=20 > $ python -c "import ctypes; print ctypes._dlopen('cygwin1.dll')" > 6442713088 >=20 > But that won't work with the former attribute-style of loading the dll. Same as on Linux: $ python -c "import ctypes; print ctypes._dlopen('libcurl')" Traceback (most recent call last): File "", line 1, in OSError: libcurl: cannot open shared object file: No such file or directory $ python -c "import ctypes; print ctypes._dlopen('libcurl.so')" 94888239442336 This was a fix for POSIX compat. There's a bit of internal magic in Cygwin's dlopen() to handle .dll vs. .so, but dlopen() does NOT add suffixes to the file on its own. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --vk/v8fjDPiDepTtA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXdS3/AAoJEPU2Bp2uRE+gpQYP/04fdSp0IaJ0CxHAF+w1OnO7 lLS+jWs4DywRGoRZ78ceO80282J9tujYLQM++JVm8BfZnNsssmZuyVNX+ylPXFLm JTGjlsOJYytt81DBYEerfo6dhLBHwFBjuE2hm6E8RVFXxXLZ3WXQrkqXLJeOfRUv KAR1fSdZ+5Q/uWCTpEoJ5QP7WKC2bQ7DwdqJK9AWs0T5qSu/Jp9Ue1pKoX40+uwF kWC1ZFkPdUtS4bD9WEDwIeLrTBdCfAihe4S1SI+ZCkpliY52wPHt/LfEpUE7GOXa D421Xwi/Hl1qXyoPntpPQ0XjwSFa7gQwzkS7fPBD7eUm+WTXBTsUc8/3oVPrgwqA +4XhPa76bqRaT3age50xr+rUTGZ5APi0TxTJ5vcBvVXG4n9tMLzEUfRgDDR1rkpt vuHIcD0TfdrblnSIo/4768/Sx/48Cu0IW1XVg/jS3VRZ84eG5DAwe6EOP1U1Xx2S v9F1ZufqAy07Kl2tq0XiOwCNYM/PXxwz3KdCiQpBonRkHVr3eN3FIhi4Eg+KOc7C DTI/i++vDl9Lg/BJYeOrRoy7GT7WPfHVRtQLisdNranYYki3jK+MGIeONMM1H3Pp 1lTf/PWW1scSvcD8C1b/JsC5wH6WmZIsM65ybrpggKFgvniXQkBUAALhpRmRNavi MeQgzxVY9FW1Vb8AMflK =oSGb -----END PGP SIGNATURE----- --vk/v8fjDPiDepTtA--