Comments (10)
Thanks all for the fix, submitting it, reviewing and approving. I just updated locally the pkgsrc entry for xmpppy to 0.6.5, built on NetBSD/9 amd64 with Python 3.9, and confirmed that with my modified xsend.py script, authentication works against ejabberd.
I am finding that xsend.py needs some extra parens in print, but that's very minor and I will try to get a PR filed about that.
from xmpppy.
Now that you've merged the authentication file change, that seems viable. I will try that and open an issue if I have any problems. Thanks for all the fixes.
from xmpppy.
Dear Greg,
thanks for reporting. I believe the example programs within the docs/examples folder haven't received any efforts to port them to Python 3 yet.
Maybe you are more lucky with basic.py or, even better, the integrated xmpp-message
command line entrypoint? The code for the latter can be found, including synopsis, at xmpp/cli.py.
With kind regards,
Andreas.
from xmpppy.
try the following patch
--- a/xmpp/auth.py
+++ b/xmpp/auth.py
@@ -38,9 +38,10 @@ def H(some):
some = some.encode("utf-8")
return md5(some).digest()
def C(some):
- if isinstance(some[0], bytes):
- some = map(str, some)
- return ':'.join(some)
+ if IS_PYTHON3:
+ some = [ x.encode('utf-8') if isinstance(x,str) else x for x in some ]
+ return b':'.join(some)
+ return ':'.join(map(str,some))
from xmpppy.
Dear David,
thank you for this patch. Can I humbly ask you to submit it as a pull request? I will be happy to publish another patch release including it.
With kind regards,
Andreas.
from xmpppy.
I had someone who uses one of my tools experience the same issue:
https://gitlab.com/djsumdog/dav-xmpp-sync/-/issues/1#note_752958838
I don't have this issue on my own XMPP server running prosidy, but I created an account on chatterboxtown.us which uses ejabberd. I was able to replicate the authentication failure.
...
while not self.set: self._owner.Process(10)
File "/home/cassius/.local/lib/python3.8/site-packages/xmpp/dispatcher.py", line 129, in Process
raise ex
File "/home/cassius/.local/lib/python3.8/site-packages/xmpp/dispatcher.py", line 307, in dispatch
handler['func'](session,stanza)
File "/home/cassius/.local/lib/python3.8/site-packages/xmpp/dispatcher.py", line 219, in streamErrorHandler
raise exc((name,text))
xmpp.protocol.NotAuthorized: ('not-authorized', '')
If I manually patched the local xmpppy in my local environment using the code provided by @D-L. Authentication works on both my prosidy server and the chatterbox/ejabberd server. I'm currently on Python 3.8.12.
For now I can monkey patch the issue using the following:
import xmpp
import sys
def _C_monkey_patch(some):
if sys.version_info >= (3, 0, 0):
some = [ x.encode('utf-8') if isinstance(x,str) else x for x in some ]
return b':'.join(some)
return ':'.join(map(str,some))
xmpp.auth.C = _C_monkey_patch
I see a PR was never submitted. I could make one. Are there any tests, code formatting checks or CI/CD pipelines in this project? I don't see any.
from xmpppy.
Hi again,
thanks again for the contribution, @D-L. @sumdog submitted your patch with #54 and we just merged it and released xmpppy version 0.6.5 to PyPI.
Please let us know if you still see any issues on this topic.
With kind regards,
Andreas.
from xmpppy.
Dear Greg,
let's just move forward with #55, implementing your request from #42, and remove xsend.py
altogether, as xmpp/cli.py
now has all the details and contains the complete canonical implementation to connect, authenticate and submit a single XMPP message.
With kind regards,
Andreas.
from xmpppy.
@sumdog: Can you publish your https://gitlab.com/djsumdog/dav-xmpp-sync on GitHub too?
A mirror?
Thanks in advance!
from xmpppy.
@sumdog: Can you publish your https://gitlab.com/djsumdog/dav-xmpp-sync on GitHub too? A mirror?
Thanks in advance!
Sorry, I purposefully put all new projects on Gitlab and have been thinking of migrating old projects off Github. It's pretty trivial to create an account there if you want to submit patches, or I can take patches via e-mail as well.
from xmpppy.
Related Issues (20)
- The future of xmpppy HOT 2
- BOSH support HOT 1
- release does not have NEWS HOT 2
- xmpp-message does not allow jid/pw to be in a file HOT 3
- `TypeError: can only concatenate str (not "bytes") to str` when connecting with ejabberd server HOT 6
- Using the basic.py script, where should its destination be sent to? HOT 2
- Error at install when reading the readme HOT 3
- #2 Error at install when reading the readme HOT 2
- Error handling is not correct (at least under Windows) HOT 2
- Local Sending Problem.
- GTalk HOT 1
- JID has no node only a domain HOT 3
- Migration to GitHub is not complete HOT 3
- Unicode-objects must be encoded before hashing HOT 1
- Add support for SOCKS proxies
- method send from Client class is not found HOT 12
- AttributeError: 'TCPsocket' object has no attribute '_sock' HOT 4
- AttributeError: module 'ssl' has no attribute 'wrap_socket' HOT 2
- Provide an explicit and configurable way to enable/disable certificate checking
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xmpppy.