<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 12, 2013 at 7:07 AM, Stefan Stanacar <span dir="ltr">&lt;<a href="mailto:stefanx.stanacar@intel.com" target="_blank">stefanx.stanacar@intel.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":zs" style="overflow:hidden">+        total = &#39;&#39;<br>
         with open(default_file, &#39;r&#39;) as f:<br>
-            contents = f.readlines()<br>
-        f.close()<br>
-<br>
-        total = &quot;&quot;<br>
-        for c in contents:<br>
-            total += c<br>
+            for line in f:<br>
+                total += line<br>
<br>
         total += &quot;#added by hob&quot;<br>
         total += &quot;\n%s += \&quot;%s\&quot;\n&quot; % (var, val)<br>
<br>
         with open(default_file, &#39;w&#39;) as f:<br>
             f.write(total)<br>
-        f.close()</div></blockquote></div><br>This is weird. Have they ever heard of opening a file in append mode? :) And obviously, splitting the contents into lines, then re-concatenating those lines into a string blob makes no sense either.<br>

-- <br>Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics
</div></div>