juftin/camply

Webhook crashes on utf-8 characters

zdwolfe opened this issue ยท 1 comments

Describe the bug

Campsite messages with UTF-8 characters cannot be parsed by the webhook notification handler.

Original Camply Command (with --debug)

 WEBHOOK_URL="http://localhost:8000" camply campsites --campground 233998 --start-date 2023-10-10 --end-date 2023-10-21  --notifications webhook

Crashes with

RuntimeError: camply encountered an error and exited ๐Ÿ˜Ÿ [2023-09-14 22:13:53] - (UnicodeEncodeError) 'latin-1' codec
can't encode character '\U0001f3d5' in position 161: Body ('๐Ÿ•') is not valid Latin-1. Use body.encode('utf-8') if you
want to send it encoded in UTF-8.

Expected behavior

A notification of form

{"campsites": [{"campsite_id": 76540, "booking_date": "2023-10-12T00:00:0

Additional context

I opened a PR for a fix a few days ago, #299 , but opening an issue to track the actual bug.

๐ŸŽ‰ This issue has been resolved in version 0.31.0 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€