public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Bug in Python3 ('tempfile', 'subprocess', '_hashlib')
@ 2018-04-06  1:14 Giuseppe Scelsi
  2018-04-06  1:46 ` Dave Caswell
  2018-04-09  1:14 ` Yaakov Selkowitz
  0 siblings, 2 replies; 4+ messages in thread
From: Giuseppe Scelsi @ 2018-04-06  1:14 UTC (permalink / raw)
  To: cygwin

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

--
Giuseppe B. Scelsi  (giuseppe.scelsi@analog.com)
Senior Design Engineer, Analog Devices Australia Pty Ltd
Unit 3, 97 Lewis Road, Wantirna, Victoria, 3152, AUSTRALIA
Direct: +61 3 9881 9909   Main: +61 3 9881 9999
Fax: +61 3 9881 9988      Web: www.analog.com/au

Embedded & Digital Signal Processing Software.

This communication is proprietary and confidential.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug in Python3 ('tempfile', 'subprocess', '_hashlib')
  2018-04-06  1:14 Bug in Python3 ('tempfile', 'subprocess', '_hashlib') Giuseppe Scelsi
@ 2018-04-06  1:46 ` Dave Caswell
  2018-04-09  1:14 ` Yaakov Selkowitz
  1 sibling, 0 replies; 4+ messages in thread
From: Dave Caswell @ 2018-04-06  1:46 UTC (permalink / raw)
  To: cygwin

On Thu, Apr 5, 2018 at 7:14 PM, Giuseppe Scelsi
<giuseppe.scelsi@analog.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@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug in Python3 ('tempfile', 'subprocess', '_hashlib')
  2018-04-06  1:14 Bug in Python3 ('tempfile', 'subprocess', '_hashlib') Giuseppe Scelsi
  2018-04-06  1:46 ` Dave Caswell
@ 2018-04-09  1:14 ` Yaakov Selkowitz
  2018-04-09 23:40   ` Giuseppe Scelsi
  1 sibling, 1 reply; 4+ messages in thread
From: Yaakov Selkowitz @ 2018-04-09  1:14 UTC (permalink / raw)
  To: cygwin

On 2018-04-05 20:14, Giuseppe Scelsi wrote:
> 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?

Not here.  This may be a fork issue though; please try rebase-trigger
all and run setup to see if that helps.

-- 
Yaakov

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug in Python3 ('tempfile', 'subprocess', '_hashlib')
  2018-04-09  1:14 ` Yaakov Selkowitz
@ 2018-04-09 23:40   ` Giuseppe Scelsi
  0 siblings, 0 replies; 4+ messages in thread
From: Giuseppe Scelsi @ 2018-04-09 23:40 UTC (permalink / raw)
  To: cygwin

Thank you guys for your help.  I did a full rebase to no avail.  But 
this now looks like an issue specific to my machine, I asked some of my 
colleagues to run some tests on their PCs and they cannot reproduce this 
issue either.  I could try to reinstall Cygwin from scratch, but I am 
going to update to a new machine soon and my workaround allows me to 
keep going for the time being, so I have decided it's not worth spending 
any more time on this, unless someone feels this could be of general 
interest.  Thanks again for your assistance.

Giuseppe

On 09/04/18 11:14, Yaakov Selkowitz wrote:
> On 2018-04-05 20:14, Giuseppe Scelsi wrote:
>> 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?
> 
> Not here.  This may be a fork issue though; please try rebase-trigger
> all and run setup to see if that helps.
> 

-- 
Giuseppe B. Scelsi  (giuseppe.scelsi@analog.com)
Senior Design Engineer, Analog Devices Australia Pty Ltd
Unit 3, 97 Lewis Road, Wantirna, Victoria, 3152, AUSTRALIA
Direct: +61 3 9881 9909   Main: +61 3 9881 9999
Fax: +61 3 9881 9988      Web: www.analog.com/au

Embedded & Digital Signal Processing Software.

This communication is proprietary and confidential.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-09 23:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-06  1:14 Bug in Python3 ('tempfile', 'subprocess', '_hashlib') Giuseppe Scelsi
2018-04-06  1:46 ` Dave Caswell
2018-04-09  1:14 ` Yaakov Selkowitz
2018-04-09 23:40   ` Giuseppe Scelsi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).