Saturday, February 14, 2015¶
I started to work on the TODO list which I started yesterday.
Lino has another subtle feature:
lino.core.model.Model.set_widget_options()
. I wanted this for
the duration
field of job
supplyments ( jobs
or art61
). A
second usage example is the number
of a
polls.Question
Hah! The Python docs contained the explanation for a “mysterious” deadlock which had caused me some “fun” during the last days. Problem:
For some reason yet to be discovered, the following test snippets can cause doctest to enter an endless loop (while python manage.py show about.DetailLayouts or python manage.py show about.WindowActions work as expected).
The solution was in subprocess.Popen.wait():
This will deadlock when using stdout=PIPE and/or stderr=PIPE and the child process generates enough output to a pipe such that it blocks waiting for the OS pipe buffer to accept more data. Use communicate() to avoid that.
Fixed a bug in atelier.test.TestCase.run_subprocess()
which
could cause a subprocess to deadlock when it generated more output
than the OS pipe buffer would swallow.
I also noticed that I appearently re-run the process a second time when it returned with a non-zero code.
Result is visible in General overview of Lino Welfare