문제

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