Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to_ical() -> str|bytes inconsistency #582

Open
niccokunzmann opened this issue Nov 6, 2023 · 0 comments
Open

to_ical() -> str|bytes inconsistency #582

niccokunzmann opened this issue Nov 6, 2023 · 0 comments

Comments

@niccokunzmann
Copy link
Member

@ennamarie19 added code in #581 (comment) to work around an inconsistency in the to_ical() functions: They return bytes or strings.
I am wondering: It seems like the library did not have major consistency changes since Python 2.7 and so I guess that bytes and strings might still be mixed because of that. I open this as a discussion about it but I think that it could also be an issue.

I assume that we rarely run into this issue because most people just use the icalendar.Calendar interface.

>>> import icalendar
>>> icalendar.Calendar().to_ical()
b'BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n'

This returns bytes.

What are your thoughts on this matter?

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

No branches or pull requests

1 participant