#38 two quick bug fixes

closed-fixed
Felix Wiemann
None
5
2007-03-21
2007-03-11
Edward Loper
No

1. In the html writer's assemble parts:

- self.parts[part] = ''.join(getattr(self, part))
+ self.parts[part] = ''.join(getattr(self, part, ()))

(since ''.join(None) raises an exception)

2. In docutils.nodes.Element.__unicode__:

- ''.join([str(c) for c in self.children]),
+ u''.join([unicode(c) for c in self.children]),

(since the children might contain unicode data)

Discussion

  • Edward Loper
    Edward Loper
    2007-03-11

    diff vs revision 5013.

     
    Attachments
  • Felix Wiemann
    Felix Wiemann
    2007-03-21

    • assigned_to: nobody --> fwiemann
    • status: open --> pending-fixed
     
  • Felix Wiemann
    Felix Wiemann
    2007-03-21

    Logged In: YES
    user_id=1374215
    Originator: NO

    Fixed the unicode issue (and added tests); thank you very much!

    Why do you need the change in assemble_parts? It seems to me that if getattr returns None, that would indicate an error, so we want it to crash, right?

     
  • Edward Loper
    Edward Loper
    2007-03-21

    • status: pending-fixed --> closed-fixed
     
  • Edward Loper
    Edward Loper
    2007-03-21

    Logged In: YES
    user_id=195958
    Originator: YES

    Ah, yes, you're correct. I wasn't thinking streight for that one (the html writer's assemble parts). So this bug can be closed. Thanks for fixing the unicode issue.