ics-py / ics-py

Pythonic and easy iCalendar library (rfc5545)

Home Page:http://icspy.readthedocs.org/en/stable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ORGANIZER not parsed correctly

AntiKippi opened this issue · comments

commented

I have a calendar with an ORGANIZER line like this:
ORGANIZER;CN="XXX:online Example Organization":MAILTO:noreply@example.org .

When this gets parsed however, the quotation marks get removed and mailto gets converted to lower case, yielding:
ORGANIZER;CN=XXX:online Example Organization:mailto:noreply@example.org

This presents a problem because if you save it like this and then parse it again, the result is this:
CN=XXX:mailto:online Example Organization:mailto:noreply@example.org

Also, I dislike that the "mailto" gets converted to lower case, but that's not that much of a problem.

Environment:

  • Arch Linux
  • Python v3.10.2
  • ics v0.7 (From the AUR)

I've attached a script reproducing the problem for reference: bug.py

Could you try again with the latest version from the master branch? You can install it with

pip install git+https://github.com/ics-py/ics-py.git

Please note that str(calendar) works differently now and you can get calendar.serialize() to get the ics representation

The "mailto" being converted to lowercase probably comes from using python's built-in urlparse to represent the URLs. One could probably use one of many other libraries (rfc3986, rfc3987, hyperlink, furl, ...) as a replacement that might allow customizing this, but I haven't looked into that. The biggest issue there is probably deciding which one to use / how to support multiple of these libraries.

commented

I've tried now, seems to work with the latest version from the master branch. so I guess this is obsolete now. However, are you going to fix this in v0.7 or will it only be fixed when v0.8 comes out?

Regarding the lowercase conversion of "mailto", would be nice if you could look at that if you get to. But as I said, this is a rather minor problem.

The "fix" probably comes from the entire parsing/serialisation system being rewritten, so a backport would be pretty much the same as a new release and that might still take some time, unfortunately.
More URL libs won't make it into that release, but I can open up an issue to at least track this.