citronalco / carddav2asterisk

Tiny Python script that reads all contacts from a CardDAV addressbook and inserts them into Asterisk's CID lookup database
GNU General Public License v3.0
17 stars 4 forks source link

binascii.Error: Incorrect padding #5

Closed mokkin closed 3 years ago

mokkin commented 5 years ago

After adding a couple of numbers of a CardDAV phonebook I'm getting the following error:

Traceback (most recent call last):
  File "/home/asterisk/carddav2asterisk/carddav2asterisk.py", line 73, in <module>
    sys.exit(main(sys.argv))
  File "/home/asterisk/carddav2asterisk/carddav2asterisk.py", line 57, in main
    vcard = vobject.readOne(r.content)
  File "/usr/lib/python2.7/site-packages/vobject/base.py", line 1078, in readOne
    ignoreUnreadable, allowQP).next()
  File "/usr/lib/python2.7/site-packages/vobject/base.py", line 1049, in readComponents
    component.setBehaviorFromVersionLine(versionLine)
  File "/usr/lib/python2.7/site-packages/vobject/base.py", line 592, in setBehaviorFromVersionLine
    if v: self.setBehavior(v)
  File "/usr/lib/python2.7/site-packages/vobject/base.py", line 108, in setBehavior
    obj.autoBehavior(True)
  File "/usr/lib/python2.7/site-packages/vobject/base.py", line 96, in autoBehavior
    self.behavior.decode(self)
  File "/usr/lib/python2.7/site-packages/vobject/vcard.py", line 120, in decode
    line.value = line.value.decode('base64')
  File "/usr/lib64/python2.7/encodings/base64_codec.py", line 42, in base64_decode
    output = base64.decodestring(input)
  File "/usr/lib64/python2.7/base64.py", line 321, in decodestring
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

btw: In general it's working fine ;)

citronalco commented 5 years ago

please see me comment for #6, seems to be quite similar

citronalco commented 3 years ago

Could not reproduce and switched to Python3 in the meantime.