From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93591 invoked by alias); 6 Apr 2018 01:46:32 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 93542 invoked by uid 89); 6 Apr 2018 01:46:32 -0000 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 Received: from mail-io0-f182.google.com (HELO mail-io0-f182.google.com) (209.85.223.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Apr 2018 01:46:30 +0000 Received: by mail-io0-f182.google.com with SMTP id m83so32836783ioi.8 for ; Thu, 05 Apr 2018 18:46:30 -0700 (PDT) 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 Received: by 10.2.138.55 with HTTP; Thu, 5 Apr 2018 18:46:27 -0700 (PDT) In-Reply-To: <8011548c-aefd-62a2-a492-69dca7646a44@analog.com> References: <8011548c-aefd-62a2-a492-69dca7646a44@analog.com> From: Dave Caswell Date: Fri, 06 Apr 2018 01:46:00 -0000 Message-ID: Subject: Re: Bug in Python3 ('tempfile', 'subprocess', '_hashlib') To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00046.txt.bz2 On Thu, Apr 5, 2018 at 7:14 PM, Giuseppe Scelsi 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@SodiumWin ~/tmp $ cat py3t.py #!/usr/bin/python3 import subprocess import _hashlib import _sha3 subprocess.run('pwd') davec@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