Closed moritzb57 closed 4 weeks ago
Thank you!
Sorry it's taken so long for me to get to this.
Just FYI, I should have paid more attention, hanow() was correct; using datetime.now() doesn't use HA's idea of what "now" is, and mocking out datetime.now() isn't really feasible. hanow() can be easily mocked, so the unit tests can work with specific dates and times. I've pushed a fix already. :)
Resolved an issue where URLs containing emojis or other non-ASCII characters caused a UnicodeEncodeError when used with urlopen. The fix includes:
datetime
module to eliminate NameErrors.urllib.parse.quote
to ensure all characters are ASCII-safe, which specifically addresses the failure when emojis are included in the URL.This update ensures the
ics_calendar
integration can handle URLs with special characters without encountering encoding issues.