notion-export-ics icon indicating copy to clipboard operation
notion-export-ics copied to clipboard

TypeError in resulting ICS file

Open filip-van-hoeckel opened this issue 4 years ago • 3 comments

After removing an erroneous character from the built-in error message and some more troubleshooting I managed to get this running. However I have the following issues:

  • settings.json is not fully respected
  • when quering the server using the settings in webapp (you might want to document that) it presents the user with a webinterface with fields for url > not populated with block/url in settings, title format > I'd expect it to use 'block' from settings for that, and resulting url (calculated)

when opening the resulting url I do get an ICS file, but with the following error for each entry SUMMARY:TypeError('__repr__ returned non-string (type NoneType)'\,) and general error Imported from Notion\, via notion-export-ics\, but failed.

I'll also include the following trace Traceback (most recent call last): File "/volume1/homes/user/cron/notion-export-ics/webapp.py", line 38, in make_ics cal = get_ical(client, calendar_url, title_format) File "/volume1/homes/user/cron/notion-export-ics/notion_ics.py", line 77, in get_ical desc += " - {}: {}\n".format(name, v) TypeError: __repr__ returned non-string (type NoneType) 192.168.0.11 - - [09/Sep/2020 09:57:14] "GET /ics?url=aHR0cHM6Ly93d3cubm90aW9uLnNvL25vd3Rvbi80NGNiYjY4MmJhYWQ0NDliODk2NzExMTYxZTY4ZTQ5MD92PWMxZGUwYzQ1ODdkODRkMDM4ODA4NDgzODNkOTk5OGM2&format=e05BTUV9 HTTP/1.1" 200 - Traceback (most recent call last): File "/volume1/homes/user/cron/notion-export-ics/webapp.py", line 38, in make_ics cal = get_ical(client, calendar_url, title_format) File "/volume1/homes/user/cron/notion-export-ics/notion_ics.py", line 77, in get_ical desc += " - {}: {}\n".format(name, v) TypeError: __repr__ returned non-string (type NoneType) 192.168.0.11 - - [09/Sep/2020 09:59:00] "GET /ics?url=aHR0cHM6Ly93d3cubm90aW9uLnNvL25vd3Rvbi80NGNiYjY4MmJhYWQ0NDliODk2NzExMTYxZTY4ZTQ5MD92PWMxZGUwYzQ1ODdkODRkMDM4ODA4NDgzODNkOTk5OGM2&format=RGVhZGxpbmU%3D HTTP/1.1" 200 -

Where to start debugging this?

filip-van-hoeckel avatar Sep 08 '20 09:09 filip-van-hoeckel

Maybe it has something to do with changes in notion-py. I monkey-patched the following methods, that's where I would start debugging (see code):

# Hack some representation stuff into notion-py

BasicBlock.__repr__ = BasicBlock.__str__ = lambda self: self.title
User.__repr__ = User.__str__ = lambda self: self.given_name or self.family_name

evertheylen avatar Sep 13 '20 19:09 evertheylen

Shouldnt the f preceding the exception statement on line 25 be omitted as well?

filip-van-hoeckel avatar Sep 14 '20 12:09 filip-van-hoeckel

Shouldnt the f preceding the exception statement on line 25 be omitted as well?

Those are python f-strings :)

evertheylen avatar Sep 20 '20 13:09 evertheylen