[Trac #904] Sugar bundlebuilder fails if there is a blank line in MANIFEST

Zarro Boogs per Child bugtracker at laptop.org
Sun Feb 18 14:41:14 EST 2007


#904: Sugar bundlebuilder fails if there is a blank line in MANIFEST
--------------------+-------------------------------------------------------
 Reporter:  leejc   |       Owner:  dcbw     
     Type:  defect  |      Status:  new      
 Priority:  low     |   Milestone:  Untriaged
Component:  sugar   |    Keywords:           
--------------------+-------------------------------------------------------
 When you are building a bundle with the Sugar bundlebuilder, if you have a
 blank line in the MANIFEST file, bundlebuilder fails with:

 {{{
 OSError: [Errno 2] No such file or directory: ''
 }}}

 This situation is particularly hard to diagnose if you have blank lines at
 the end of the file.

 I suggest replacing line 61 of sugar/activity/bundlebuilder.py:

 {{{
             self.append(line[:-1])
 }}}
 with:
 {{{
             if line.strip():
                 self.append(line.strip())
 }}}

 This also handles trailing whitespace better, as well as the (unlikely)
 case where the last line in the file doesn't have a newline.

-- 
Ticket URL: <http://dev.laptop.org/ticket/904>
One Laptop Per Child <http://laptop.org/>



More information about the Bugs mailing list