[Bugs] #1040 UNSP: Traceback when copying file of unknown MIME type to USB stick

SugarLabs Bugs bugtracker-noreply at sugarlabs.org
Mon Jul 27 05:44:53 EDT 2009


#1040: Traceback when copying file of unknown MIME type to USB stick
------------------------------------------+---------------------------------
    Reporter:  sascha_silbe               |          Owner:  tomeu            
        Type:  defect                     |         Status:  new              
    Priority:  Unspecified by Maintainer  |      Milestone:  0.86             
   Component:  sugar                      |        Version:  Git as of bugdate
    Severity:  Unspecified                |     Resolution:                   
    Keywords:  r+                         |   Distribution:  Unspecified      
Status_field:  New                        |  
------------------------------------------+---------------------------------
Changes (by tomeu):

  * keywords:  r? => r+


Comment:

 Please try to follow the PEP 8 recommendations and specially the style of
 the already existing code. I have modified your code to comply with that,
 is more verbose but safer and more readable.

 http://git.sugarlabs.org/projects/sugar/repos/mainline/commits/81eaa9b6f3

 Specifically:

 {{{
     - Comparisons to singletons like None should always be done with
       'is' or 'is not', never the equality operators.

       Also, beware of writing "if x" when you really mean "if x is not
 None"
       -- e.g. when testing whether a variable or argument that defaults to
       None was set to some other value.  The other value might have a type
       (such as a container) that could be false in a boolean context!
 }}}

 {{{
     Avoid extraneous whitespace in the following situations:

     - Immediately inside parentheses, brackets or braces.

       Yes: spam(ham[1], {eggs: 2})
       No:  spam( ham[ 1 ], { eggs: 2 } )

     - Immediately before a comma, semicolon, or colon:

       Yes: if x == 4: print x, y; x, y = y, x
       No:  if x == 4 : print x , y ; x , y = y , x
 }}}

 Thanks a lot for the patch!

-- 
Ticket URL: <http://dev.sugarlabs.org/ticket/1040#comment:3>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list