Skip to content

to_ical() -> str|bytes inconsistency #582

Open
@niccokunzmann

Description

@niccokunzmann

@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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions