Message315105
A sub-millisecond wait is fairly quick, but it depends on the machine speed. I should have included a counter. Try the following. It's not reproducing the problem if num_retries doesn't get incremented.
import os
import time
ERROR_DIR_NOT_EMPTY = 145
PARENT_PATH = 'foo'
CHILD_PATH = os.path.join(PARENT_PATH, 'bar')
os.rmdir(CHILD_PATH)
num_retries = 0
t0 = time.perf_counter()
while True:
try:
os.rmdir(PARENT_PATH)
break
except OSError as e:
if e.winerror != ERROR_DIR_NOT_EMPTY:
raise
num_retries += 1
wait_time = time.perf_counter() - t0
print('num_retries:', num_retries)
print('wait_time:', wait_time) |
|
Date |
User |
Action |
Args |
2018-04-09 02:41:52 | eryksun | set | recipients:
+ eryksun, paul.moore, giampaolo.rodola, tim.golden, tarek, zach.ware, steve.dower, yuliu |
2018-04-09 02:41:52 | eryksun | set | messageid: <1523241712.26.0.682650639539.issue33240@psf.upfronthosting.co.za> |
2018-04-09 02:41:52 | eryksun | link | issue33240 messages |
2018-04-09 02:41:51 | eryksun | create | |
|