[Scons-users] Intermittent Install() failure

Fred Wright fw at fwright.net
Tue Jul 19 18:52:43 EDT 2016


On Tue, 19 Jul 2016, [gb2312] Arvid Ros¨¦n wrote:

> I have had problems with builders using Python open() in Builders on Windows. How should that be handled to be safe?

The preferred approach (as long as you're not trying to handle Python
earlier than 2.5) is to use the "with open(...) as <f>" construct, which
guarantees to close the file when the with block is exited, including via
exceptions.  This of course assumes that you don't need the file open
outside the block. :-)

Fred Wright


More information about the Scons-users mailing list