#7310 NORM Never A: activitybundle.py does not remove trailing newlines

Zarro Boogs per Child bugtracker at laptop.org
Wed Jun 18 21:04:15 EDT 2008


#7310: activitybundle.py does not remove trailing newlines
--------------------------+-------------------------------------------------
 Reporter:  homunq        |       Owner:  marco         
     Type:  defect        |      Status:  new           
 Priority:  normal        |   Milestone:  Never Assigned
Component:  not assigned  |     Version:  Update.1      
 Keywords:                |    Verified:  0             
 Blocking:                |   Blockedby:                
--------------------------+-------------------------------------------------
 In activitybundle.py, the block (91-93):


         # Remove trailing newlines, they do not help keep absolute
 position.
         while lines and lines[-1] == "":
             lines = lines[:-1]

 should go after the following for block (or in both places), or lines that
 are blanked by the for block will not be removed. Besides being silly,
 this would lead to spurious newlines surviving fix_manifest, and could
 lead to an (effectively) empty manifest not being caught by a build
 command.

 If you wanted to, you could do it before AND after to avoid extra passes
 through the for loop.

 Note:
         i = len(lines) - 1
         while i >= 0 and not lines[i]:
             i -= 1
         lines = lines[:i]

 is slightly faster if you're going to do it twice (before and after).

-- 
Ticket URL: <http://dev.laptop.org/ticket/7310>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list