[GH-ISSUE #1410] possible bug with python - unicode emoji #993

Closed
opened 2026-05-07 00:29:25 +02:00 by BreizhHardware · 2 comments

Originally created by @Diglador on GitHub (Aug 2, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1410

🐞 Describe the bug

Unicode emojis if more than "some" will break message or leading to send message as attachment (not full anyway)

#!/usr/bin/env python3
import requests
requests.post("https://ntfy.sh/test",
data="this is test\U0001f94a A \U0001f7e6 B \U0001f7e6 C ",
headers={
"X-Title": "test",
"Priority": "3",
"Tags": "red_square"
})
💻 Components impacted

💡 Screenshots and/or logs

🔮 Additional context

Originally created by @Diglador on GitHub (Aug 2, 2025). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1410 :lady_beetle: **Describe the bug** <!-- A clear and concise description of the problem. --> Unicode emojis if more than "some" will break message or leading to send message as attachment (not full anyway) #!/usr/bin/env python3 import requests requests.post("https://ntfy.sh/test", data="this is test\U0001f94a A \U0001f7e6 B \U0001f7e6 C ", headers={ "X-Title": "test", "Priority": "3", "Tags": "red_square" }) :computer: **Components impacted** <!-- ntfy server, Android app, iOS app, web app --> :bulb: **Screenshots and/or logs** <!-- If applicable, add screenshots or share logs help explain your problem. To get logs from the ... - ntfy server: Enable "log-level: trace" in your server.yml file - Android app: Go to "Settings" -> "Record logs", then eventually "Copy/upload logs" - web app: Press "F12" and find the "Console" window --> :crystal_ball: **Additional context** <!-- Add any other context about the problem here. -->
BreizhHardware 2026-05-07 00:29:25 +02:00
  • closed this issue
  • added the
    🪲 bug
    label
Author
Owner

@binwiederhier commented on GitHub (Aug 8, 2025):

This seems to work just fine:

$ cat /tmp/a
#!/usr/bin/env python3
import requests
requests.post("https://ntfy.sh/mytopic",
data="this is test\U0001f94a A \U0001f7e6 B \U0001f7e6 C ",
headers={
"X-Title": "test",
"Priority": "3",
"Tags": "red_square"
})

$  python3 /tmp/a
Image

Must be something in your environment. Closing this for now.

<!-- gh-comment-id:3169208999 --> @binwiederhier commented on GitHub (Aug 8, 2025): This seems to work just fine: ``` $ cat /tmp/a #!/usr/bin/env python3 import requests requests.post("https://ntfy.sh/mytopic", data="this is test\U0001f94a A \U0001f7e6 B \U0001f7e6 C ", headers={ "X-Title": "test", "Priority": "3", "Tags": "red_square" }) $ python3 /tmp/a ``` <img width="1079" height="281" alt="Image" src="https://github.com/user-attachments/assets/39d87d71-055b-4467-bcb7-6cb164a9cd6a" /> Must be something in your environment. Closing this for now.
Author
Owner

@Diglador commented on GitHub (Aug 9, 2025):

och sorry , i just tested it with second linux distro where it works.....so yes , something wrong with python "requests" library.
Och God.....its a simple requests library. But ok - its an older Debian version.
Workaround solved my problem:
data= "this is test\U0001f94a\ A \U0001f7e6\ B \U0001f7e6 C ".encode('utf-8'),

Sorry for your time. Big apologies.

<!-- gh-comment-id:3170692608 --> @Diglador commented on GitHub (Aug 9, 2025): och sorry , i just tested it with second linux distro where it works.....so yes , something wrong with python "requests" library. Och God.....its a simple requests library. But ok - its an older Debian version. Workaround solved my problem: data= "this is test\U0001f94a\ A \U0001f7e6\ B \U0001f7e6 C ".encode('utf-8'), Sorry for your time. Big apologies.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#993
No description provided.