[Calendarserver-maintainers] Bug#849882: python-vobject: Should TimezoneComponent.prettyPrint() have default arguments?

Petter Reinholdtsen pere at hungry.com
Sun Jan 1 23:04:56 UTC 2017


Package: python-vobject
Version: 0.8.1c-4

Should the TimezoneComponent.prettyPrint() function use the same default
values as the equivalent function in other classes?  I discovered that
The method in TimezoneComponent have this prototype:

    def prettyPrint(self, level, tabwidth):

While the base class Component have this prototype:

    def prettyPrint(self, level = 0, tabwidth=3):

This made my code fail with this message:

  <VTIMEZONE | <TZID{}Europe/Stockholm>>
  Traceback (most recent call last):
    File "/home/pere/bin/ical-split", line 119, in <module>
      print c.prettyPrint()
  TypeError: prettyPrint() takes exactly 3 arguments (1 given)

This code demonstrates the problem:

  import vobject
  icalstream = open(file)
  components = vobject.readComponents(icalstream, validate=True)
  cal = components.next()
  for c in cal.getChildren():
    print c.prettyPrint()

-- 
Happy hacking
Petter Reinholdtsen



More information about the Calendarserver-maintainers mailing list