[issue35633] test_eintr fails on AIX since fcntl functions were modified

Michael Felt report at bugs.python.org
Sat Jan 5 11:26:53 EST 2019


Michael Felt <aixtools at felt.demon.nl> added the comment:

On 04/01/2019 23:42, STINNER Victor wrote:
> STINNER Victor <vstinner at redhat.com> added the comment:
>
> Does the test pass if you open the file in read+write ("w+b") mode rather than write-only ("wb") mode?
>
> I'm talking about this line:
>
> open(support.TESTFN, 'wb')
>
> Note: if you want to test, you have the modify the mode twice:
>   "with open('%s', 'wb') as f:" % support.TESTFN,
> and
>   with open(support.TESTFN, 'wb') as f:

Without except containing PermissionError:

  +500          with kill_on_error(proc):
  +501              with open(support.TESTFN, 'w+b') as f:
  +502                  while True:  # synchronize the subprocess
  +503                      dt = time.monotonic() - start_time
  +504                      if dt > 60.0:
  +505                          raise Exception("failed to sync child in
%.1f sec" % dt)
  +506                      try:
  +507                          lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
  +508                          lock_func(f, fcntl.LOCK_UN)
  +509                          time.sleep(0.01)
  +510                      except BlockingIOError:
  +511                          break
FAILS on test_lockf, passes on test_flock -> with open(support.TESTFN,
'w+b') as f:

FAILS on both test_lockf and test_flock (as expected I am guessing) ->
with open(support.TESTFN, 'r+b') as f:

I am not python savvy enough to get it tested using the syntax: ' "with
open('%s', 'wb') as f:" % support.TESTFN, '

  +500          with kill_on_error(proc):
  +501              "with open('%s', 'wb') as f:" % support.TESTFN,
  +502                  while True:  # synchronize the subprocess
  +503                      dt = time.monotonic() - start_time
  +504                      if dt > 60.0:
  +505                          raise Exception("failed to sync child in
%.1f sec" % dt)
  +506                      try:
  +507                          lock_func(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
  +508                          lock_func(f, fcntl.LOCK_UN)
  +509                          time.sleep(0.01)
  +510                      except BlockingIOError:
  +511                          break

--- run eintr_tester.py ---
  File
"/data/prj/python/git/python3-3.8/Lib/test/eintrdata/eintr_tester.py",
line 502
    while True:  # synchronize the subprocess
    ^
IndentationError: unexpected indent
--- eintr_tester.py completed: exit code 1 ---

>
> ----------
> nosy: +vstinner
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <https://bugs.python.org/issue35633>
> _______________________________________
>

----------
title: test_eintr: test_lockf() fails with "PermissionError: [Errno 13] Permission denied" on AIX -> test_eintr fails on AIX since fcntl functions were modified

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35633>
_______________________________________


More information about the Python-bugs-list mailing list