Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

TypeError in resulting ICS file #6

Open
filip-van-hoeckel opened this issue Sep 8, 2020 · 3 comments
Open

TypeError in resulting ICS file #6

filip-van-hoeckel opened this issue Sep 8, 2020 · 3 comments

Comments

@filip-van-hoeckel
Copy link

filip-van-hoeckel commented Sep 8, 2020

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 filip-van-hoeckel changed the title Do I need to install Flask? TypeError in resulting ICS file Sep 9, 2020
@evertheylen
Copy link
Owner

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

@filip-van-hoeckel
Copy link
Author

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

@evertheylen
Copy link
Owner

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

Those are python f-strings :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants