After a painful search for Python XMPP library to use for XEP 060 I finally decided on wokkel and twisted.

However, they cannot understand the simple JID escaping of XEP-106

I am trying to pass username as an email address so I escape it like this admin\40local.domain@mydomain.tldr where the username is admin@local.domain

The program complains about invalid character in username Should I try another library that does work? and has documentation. I would really appreciate the help.

有帮助吗?

解决方案

This is just a guess, but if you have the username or JID in a string, and are specifying it like:

"admin\40local.domain@mydomain.tld"

If so, Python treats backslash escape codes specially. Change it to a double backslash to actually insert a single backslash into the string:

"admin\\40local.domain@mydomain.tld"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top