delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/04/05/21:46:42

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:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=LEFY0pG
Wg6NU3vu+tKsO9Bx0YEtCRUxvQKFSta4p9qXjLp/SXjNQtou4u/USx9iZ0YReXuN
oTlw2LrBOHqFLCQ8Aqv5P3klH8HLiN38OacPq6j3JbBmnjzPqttUhQyAYrDHNG3R
HkEk810fvvRNgrN+v4Nd4G6M5YLa8G8TFq34=
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:in-reply-to:references:from:date
:message-id:subject:to:content-type; s=default; bh=v0pF+z0FEyjMN
RqDr5yA54xFPGo=; b=PK9A6Duj8rbSeA0Yyg3hlBFsno+WbjFUBl6o4sdMC9wQI
Slhn5uW/A2vEQwXx2ce4SwoT2S7pZyWzeV5jX21Qeceibcud1BRpGO1bMiheBeF7
4LpO34fjcF7TstLW0pDnfqjg+uY1shDYPtraQNH175b4nLTHm/R2JhT7Yp72ps=
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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Best
X-HELO: mail-io0-f182.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=JMcAQ91ougd2na4pC/jvfstyV999gmr8dQkphNX+vtw=; b=C1DWobzuzpnuAFVh9935e7KNmkzKoLMSF2+wi8syktbMHop0RZ2xOBMzQFA/Tv/cWa bFen/hKIacASthWgNjIk3MBoMYRAU6+Z9bcKsDI3JAurvt2PkqzhBFqqYRdrSDh/FM2I ZR09AKZx+9K+EuHrrBw6R0v36kB/QIN3IGBNwT/C0iGkVs7RJHo+ATfZ8FEM3x1baevk qbTJf0aFu8iLhCaNtRz7ne5gc1pqxrFosi+JpXcwuw9WUNHlFo6sw1NC0SLVUGuvgcuX r9zqBJb3cmwcPUMnv2GFzt5/xnuXDV4BoRWnhZnSY9cosnHnIPp3V7ifAWydSu+ovKkB Uvsw==
X-Gm-Message-State: ALQs6tBEMCSly4L4hRnomXQiWPCTItdIOVwvK0aOpcADp08aMV1BhF7S /J+NTpOQ2YpZEqMMMjokyxI9A//7oqBW5zZmeBCMGa0L
X-Google-Smtp-Source: AIpwx4+QadVwrlXc7VxFt9Fd1TS0omc2iZMpHZXTUgY2VP11LjXlyEDOcD+KnEY/vu/BO0FQU4Sl3HaL0fvC79v4Oc4=
X-Received: by 10.107.157.75 with SMTP id g72mr23486017ioe.240.1522979188096; Thu, 05 Apr 2018 18:46:28 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <8011548c-aefd-62a2-a492-69dca7646a44@analog.com>
References: <8011548c-aefd-62a2-a492-69dca7646a44 AT analog DOT com>
From: Dave Caswell <dave DOT caswell AT gmail DOT com>
Date: Thu, 5 Apr 2018 19:46:27 -0600
Message-ID: <CAG2dRtGjnCB=iJCUWEcqbNJsyJSnUBTiOioL_GjhYT8y4o9uoA@mail.gmail.com>
Subject: Re: Bug in Python3 ('tempfile', 'subprocess', '_hashlib')
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

On Thu, Apr 5, 2018 at 7:14 PM, Giuseppe Scelsi
<giuseppe DOT scelsi AT analog DOT com> wrote:
> Hi,
>
> Using freshly-updated Cygwin 64-bit under Windows 7 Enterprise Ver 6.1
> and Python 3 version 3.6.4.
>
> The execution of the following script:
>
>     import subprocess
>     import _hashlib
>     import _sha3
>     subprocess.run('pwd')
>
> always results in 'BlockingIOError: [Errno 11] Resource temporarily
> unavailable'.
>
> I saw this error first in a script that imported 'tempfile' together
> with 'subprocess' (in any order):
>
>     import subprocess
>     import tempfile
>     subprocess.run('pwd')
>
> I then managed to narrow down the problem to the '_sha3' module.
> Notice that you need to import both '_hashlib' and '_sha3' *in that
> order*.  If I swap the order and import '_sha3' before '_hashlib', the
> error becomes sporadic, sometimes it happens and sometimes not.
>
> This problem makes it impossible to use 'tempfile' and 'subprocess' in
> the same script.  My workaround is currently to disable '_sha3' in
> '/lib/python3.6/hashlib.py' by adding at line 62:
>
>     __always_supported = __always_supported[0:8]
>
> This problem only happens in Cygwin 64, 32-bit Cygwin works ok.
>
> Can anyone reproduce this problem?
>
> Best regards,
>
> Giuseppe
>

Tried to reproduce:

davec AT SodiumWin ~/tmp
$ cat py3t.py
#!/usr/bin/python3

import subprocess
import _hashlib
import _sha3
subprocess.run('pwd')

davec AT SodiumWin ~/tmp
$ ./py3t.py
/home/davec/tmp

Everything seems to work OK for me.  This is with a recently updated Cygwin 64.

--
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

- Raw text -


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