jajcus / pyxmpp2 Goto Github PK
View Code? Open in Web Editor NEWXMPP implementation for Python
Home Page: http://jajcus.github.com/pyxmpp2/api/
License: GNU Lesser General Public License v2.1
XMPP implementation for Python
Home Page: http://jajcus.github.com/pyxmpp2/api/
License: GNU Lesser General Public License v2.1
lines 489 and 490 need to be reversed in [source:trunk/pyxmpp/jabber/vcard.py##L489 vcard.py]
{{{
value=[""]_7
v=value.split(";")
}}}
should be
{{{
v=value.split(";")
value=[""]_7
}}}
Copy of the PyXMPP issue Jajcus/pyxmpp#12
on client connect with pyxmpp to a jabberd2 server, a "no nonce" error ococurs.
this is because the parser returns " charset" " user" and so one...
the simple strimcompare fails.
I add a small strip.
I dont know if this breaks something: but it works.
I already build at the ComponentStream...
(with an very old version I hacked component 2.0 support in)
(but with current this doenst work - i will expect this later)
patch:
--- pyxmpp/sasl/digest_md5.py (Revision 677)
+++ pyxmpp/sasl/digest_md5.py (Arbeitskopie)
@@ -254,6 +254,7 @@
var=m.group("var")
val=m.group("val")
self.__logger.debug("%r: %r" % (var,val))
var=var.lstrip(' ');
if var=="realm":
realms.append(_unquote(val))
elif var=="nonce":
Questions(jabber*G): white at addoma.de
Copy of the PyXMPP issue Jajcus/pyxmpp#25
python 2.6 and pyxmpp 1.0.1 results in
{{{
.../pyxmpp/jabberd/componentstream.py:27: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
}}}
pls fix :)
Copy of the PyXMPP issue Jajcus/pyxmpp#32
Hi,
I'm working on jabberd2 to implement c2s SASL external authentication based on TLS certificates.
I've used pyxmpp as the testing library for the connections and I can only say it works :)
Implemented stuff:[[BR]]
The following stadards were used:[[BR]]
The following patch is made against pyxmpp-1.0.1 release tarball. I'm also attaching a testing script which successfully connects to my modified jabberd2 server (patches to that server will be posted soon).
Copy of the PyXMPP issue Jajcus/pyxmpp#35
When using the default tls certificate verify function, the following exception appears:
Traceback (most recent call last):
File "/usr/lib64/python2.4/site-packages/pyxmpp/streamtls.py", line 376, in tls_default_verify_callback
if ok and not tls_is_certificate_valid(store_context):
It is easily fixed by adding the missing "self." in front of tls_is_certificate_valid on line 376 in streamtls.py.
I experienced the problem with pyxmpp-1.0.0.s20061212.
Copy of the PyXMPP issue Jajcus/pyxmpp#9
in processing input bind result stanza:
[email protected]/pyxmpp
to="myserver.com/838805ce" field was incorrect processed.
suggestion :
insert after stanzaprocessor.py line 265 :
if to and to.node == None :
to = None
Copy of the PyXMPP issue Jajcus/pyxmpp#27
Implement http://xmpp.org/extensions/xep-0115.html
I am listed as one of the authors. I fill obliged. :-)
[source:trunk/pyxmpp/jabber/vcard.py##L394 line 394 of vcard.py] fails when there is no key {{{"value"}}} in the {{{rfc2425parameters}}} dict object. The current code below:
{{{
if rfc2425parameters.get("value").lower()=="uri":
}}}
when {{{"value"}}} does not exist in the dictionary, {{{get("value")}}} returns {{{None}}}, resulting in {{{None.lower()}}} which finally throws an exception:
{{{
AttributeError: 'NoneType' object has no attribute 'lower'
}}}
This is caused by the default return value from get, which itself defaults to {{{None}}}. My fix is to include a default value of empty string:
{{{
if rfc2425parameters.get("value", '').lower()=="uri":
I also had some trouble with not all of the attributes being initialized when parsing from !rfc2425 versions, my fix is to move the initialization with {{{None}}} out of the if statement on [source:trunk/pyxmpp/jabber/vcard.py##L370 line 370 of vcard.py].
{{{
if isinstance(value,libxml2.xmlNode):
self.uri,self.type,self.image=[None]_3
}}}
becomes
{{{
self.uri,self.type,self.image=[None]_3
if isinstance(value,libxml2.xmlNode):
}}}
Copy of the PyXMPP issue Jajcus/pyxmpp#13
SVN commits and Trac ticket changes notifications should be tested.
Copy of the PyXMPP issue Jajcus/pyxmpp#1
just change line 242 from[[BR]]
{{{pr=Presence(stanza_type=accept_responses[self.get_type()],}}}[[BR]]
to[[BR]]
{{{pr=Presence(stanza_type=deny_responses[self.get_type()],}}}
Copy of the PyXMPP issue Jajcus/pyxmpp#7
test
Copy of the PyXMPP issue Jajcus/pyxmpp#6
when using function roster.add_item:
may be passed. instead, when using function roster.remove_item:
=> roster.remove_item should comply and accept:
r.
Copy of the PyXMPP issue Jajcus/pyxmpp#20
pyxmpp.revision is constructed using a
Copy of the PyXMPP issue Jajcus/pyxmpp#17
setup.py should check dependencies and show what is missing.
Copy of the PyXMPP issue Jajcus/pyxmpp#2
In the xmppstringprep.py file I've notice a probable bug in bidi_check function:
in the 231 and 233 lines the code assign 1 in has_l line, but the 231 lines should be assign this value to has_ral, I think.
Copy of the PyXMPP issue Jajcus/pyxmpp#19
When type == None it said to be treated as "normal" but the assignment is incorrect:
{{{
if not typ:
typ=="normal"
}}}
should be:
{{{
if not typ:
typ="normal"
}}}
Copy of the PyXMPP issue Jajcus/pyxmpp#39
Hi,
the PyXMPP API currently on http://pyxmpp.jajcus.net/api/ seems to be quite out of date, e.g. it doesn't have anything on interfaces, which seem to be quite important in the current state of PyXMPP.
Would you might updating it?
cheers,
B.
Copy of the PyXMPP issue Jajcus/pyxmpp#11
Implement the client side of http://xmpp.org/rfcs/rfc6121.html#roster
hi, I'm looking some way to monitor raw xml stream, and noticed that in changelog of 2003:
2003-08-08 08:02 +0000 [r96] Jacek Konieczny [email protected]
* pyxmpp/stream.py:
- data_in() and data_out() methods to override for 'raw XML
console'
but data_in() and data_out methods are missing in the new version.
How can I monitor the raw xml stream?
Copy of the PyXMPP issue Jajcus/pyxmpp#29
Nice to have โ Jingle support and related stuff for XMPP-based VoIP.
Add PyXMPP2 MainLoop
interface for GLib. This should prove PyXMPP2 can be integrated with anything.
I needed thread-safety for timeout callbacks, to ensure that only one of the response/error/timeout callbacks can be called.
The patches are centered around the implementation of {{{dict.pop()}}} for the {{{ExpiringDictionary}}} and transactional removal from the dictionary before doing callbacks. This prevents another callback from being called while the first one is in progress.
patches attached.
Copy of the PyXMPP issue Jajcus/pyxmpp#31
Implement http://xmpp.org/extensions/xep-0092.html
iq with unknown type makes jabber loop throw exception.
how to reproduce:
send such iq from Psi XML console:
and application listening on [email protected]/someresource will exit with such traceback:
Traceback (most recent call last):
File "core.py", line 28, in ?
jab.loop(1)
File "/usr/lib/python2.4/site-packages/pyxmpp/client.py", line 240, in loop
act=stream.loop_iter(timeout)
File "/usr/lib/python2.4/site-packages/pyxmpp/streambase.py", line 619, in loop_iter
return self._loop_iter(timeout)
File "/usr/lib/python2.4/site-packages/pyxmpp/streambase.py", line 637, in _loop_iter
self._process()
File "/usr/lib/python2.4/site-packages/pyxmpp/streamtls.py", line 178, in _process
StreamBase._process(self)
File "/usr/lib/python2.4/site-packages/pyxmpp/streambase.py", line 658, in _process
self._read()
File "/usr/lib/python2.4/site-packages/pyxmpp/streamtls.py", line 173, in _read
StreamBase._read(self)
File "/usr/lib/python2.4/site-packages/pyxmpp/streambase.py", line 682, in _read
self._feed_reader(r)
File "/usr/lib/python2.4/site-packages/pyxmpp/streambase.py", line 698, in _feed_reader
r=self._reader.feed(data)
File "/usr/lib/python2.4/site-packages/pyxmpp/xmlextra.py", line 539, in feed
return self.reader.feed(s)
File "/usr/lib/python2.4/site-packages/pyxmpp/xmlextra.py", line 59, in _stanza
self.stanza(doc,node)
File "/usr/lib/python2.4/site-packages/pyxmpp/streambase.py", line 422, in stanza
self._process_node(node)
File "/usr/lib/python2.4/site-packages/pyxmpp/stream.py", line 107, in _process_node
StreamBase._process_node(self,xmlnode)
File "/usr/lib/python2.4/site-packages/pyxmpp/streambase.py", line 731, in _process_node
self.process_stanza(stanza)
File "/usr/lib/python2.4/site-packages/pyxmpp/stanzaprocessor.py", line 235, in process_stanza
if self.process_iq(stanza):
File "/usr/lib/python2.4/site-packages/pyxmpp/stanzaprocessor.py", line 111, in process_iq
r=stanza.make_error_response("feature-not-implemented")
File "/usr/lib/python2.4/site-packages/pyxmpp/iq.py", line 99, in make_error_response
raise StanzaError,"Errors may only be generated for 'set' or 'get' iq"
pyxmpp.stanza.StanzaError: Errors may only be generated for 'set' or 'get' iq
Copy of the PyXMPP issue Jajcus/pyxmpp#3
As in summary. Documentation for Stanza.get_from_jid() states that this method returns a unicode object, when in fact pyxmpp.jid.JID is returned.
Copy of the PyXMPP issue Jajcus/pyxmpp#16
Forwarded message from Debian bug #530498
From: Tim Retout [email protected]
To: Debian Bug Tracking System [email protected]
Subject: python-pyxmpp-doc: echobot.py fails on "normal" message type
Date: Mon, 25 May 2009 08:34:59 +0100
Package: python-pyxmpp-doc
Version: 1.0.1-1
Severity: minor
Tags: patch
There's a small problem in the echobot.py example script when the
received message is the "normal" type. This is the end of the stack
trace:
File "echobot.py", line 75, in message
print u'Type: "normal".' % (t,)
TypeError: not all arguments converted during string formatting
Here is a fix:
--- examples/echobot.py.orig 2009-05-25 08:24:16.000000000 +0100
+++ examples/echobot.py 2009-05-25 08:25:17.000000000 +0100
@@ -72,7 +72,7 @@
if t:
print u'Type: "%s".' % (t,)
else:
print u'Type: "normal".' % (t,)
print u'Type: "normal".'
if stanza.get_type()=="headline":
# 'headline' messages should never be replied to
return True
Copy of the PyXMPP issue Jajcus/pyxmpp#36
Hi,
I'm working on jabberd2 to implement c2s SASL external authentication based on TLS certificates.
I've used pyxmpp as the testing library for the connections and I can only say it works :)
Implemented stuff:
The following stadards were used:
The following patch is made against pyxmpp-1.0.1 release tarball. I'm also attaching a testing script which successfully connects to my modified jabberd2 server (patches to that server will be posted soon).
Copy of the PyXMPP issue Jajcus/pyxmpp#34
Most command-line based PyXMPP2 application would need similar command line interface to initialize the XMPPSettings
object. This should be automated in PyXMPP. All needed meta-data is already there.
There should be an interface to return an argparse.ArgumentParser
instance with a common options. It should be flexible-enough for most common use cases.
dataforms.Option.label and dataforms.Field.type are optional as per JEP-0004
dataforms.py always attaches these attributes when building the xml.
patch below:
{{{
--- pyxmpp/jabber/dataforms.py (revision 661)
+++ pyxmpp/jabber/dataforms.py (working copy)
@@ -70,7 +70,8 @@
- xmlnode
: libxml2.xmlNode
- doc
: libxml2.xmlDoc
"""
_unused = doc
xmlnode.setProp("label", self.label.encode("utf-8"))
if self.label is not None:
xmlnode.setProp("label", self.label.encode("utf-8"))
for value in self.values:
xmlnode.newTextChild(xmlnode.ns(), "value", value.encode("utf-8"))
return xmlnode
doc
: libxml2.xmlDoc
""" xmlnode.setProp("type", self.type)
if self.type is not None:
xmlnode.setProp("type", self.type)
if not self.label is None:
xmlnode.setProp("label", self.label)
if not self.name is None:
Copy of the PyXMPP issue Jajcus/pyxmpp#8
{{{
pyxmpp-based handler has following code:
{{{
def _message_any(self, msg):
user = self.registry.get(jid_to_dbkey(msg.get_from()))
if user is None:
self.stream.send(msg.make_error_response('forbidden'))
return True
...
}}}
and this code produces following stanza coming to client:
{{{
As far as I understand, subject and body have incorrect namespace (and psi ignores these body and subject).
Possible hackish workaround is to call
{{{
def strip_pyxmpp_ns(stanza):
from pyxmpp.xmlextra import COMMON_NS, common_doc
namespaces = {'pyxmpp': COMMON_NS }
badnodes = stanza.xpath_eval('pyxmpp:*', namespaces)
if badnodes:
logging.debug("pyxmpp bug workaround: striping namespace from %s" % badnodes)
for node in badnodes:
nslist = node.removeNsDef(COMMON_NS)
if nslist is not None:
node.reconciliateNs(common_doc)
nslist.freeNsList()
}}}
Copy of the PyXMPP issue Jajcus/pyxmpp#24
According to XEP-004, Option elements can't have more than 1 element. pyxmpp uses "values" argument to Option constructor to create multiple elements, which has no use and is against the specification. Passing a single-element list containing a string is not intuitive and error prone. Passing a "vaa" string produces output like:
v a aCopy of the PyXMPP issue Jajcus/pyxmpp#18
python-lxml can deal with incremental parsing, reducing the complexity, making the code easier to use and embed.
No need for locking, no need for custom extensions.
http://codespeak.net/lxml/tutorial.html#incremental-parsing
and namespaces are much easier to deal with using lxml.
Copy of the PyXMPP issue Jajcus/pyxmpp#38
Currently language is only negotiated and set for the stream root. In XMPP any XML element containing readable text can have a language specified and usually can be provided in many language versions. Details are described in RFC 6120.
In particular the following elements can have alternate languages:
All these should be handled with the same API, probably using some 'multi-language string' type instead of plain unicode
for appropriate properties.
xmlextra.endElement() eats exceptions, instead of letting them propagate.
While it's bad style to let exceptions get away from callbacks, it may happen and then errors don't get reported. In my case an unexpected UnicodeEncodeError from pyxmpp code itself wasn't caught in my code, wreaked some havoc and vanished without a trace. Not a pleasant thing to debug.
Relevant part of a stack from my case to illustrate the issue:
{{{
File "/home/karol/programowanie/pyxmpp/pyxmpp/xmlextra.py", line 214, in endElement
self._handler.stanza(self._doc, node1)
File "/home/karol/programowanie/pyxmpp/pyxmpp/streambase.py", line 401, in stanza
self._process_node(node)
File "/home/karol/programowanie/pyxmpp/pyxmpp/stream.py", line 107, in _process_node
StreamBase._process_node(self,xmlnode)
File "/home/karol/programowanie/pyxmpp/pyxmpp/streambase.py", line 710, in _process_node
self.process_stanza(stanza)
File "/home/karol/programowanie/pyxmpp/pyxmpp/stanzaprocessor.py", line 274, in process_stanza
if self.process_message(stanza):
File "/home/karol/programowanie/pyxmpp/pyxmpp/stanzaprocessor.py", line 209, in process_message
return self.__try_handlers(self._message_handlers,"normal",stanza)
File "/home/karol/programowanie/pyxmpp/pyxmpp/stanzaprocessor.py", line 185, in __try_handlers
response = handler(stanza)
File "/home/karol/programowanie/soc/tmp/jabberbot/xmppbot.py", line 372, in handle_message
response = self.handle_internal_command(sender, command)
File "/home/karol/programowanie/soc/tmp/jabberbot/xmppbot.py", line 402, in handle_internal_command
self.send_search_form(sender)
File "/home/karol/programowanie/soc/tmp/jabberbot/xmppbot.py", line 319, in send_search_form
message.add_content(form)
File "/home/karol/programowanie/pyxmpp/pyxmpp/stanza.py", line 303, in add_content
content.as_xml(parent = self.xmlnode, doc = common_doc)
File "/home/karol/programowanie/pyxmpp/pyxmpp/objects.py", line 91, in as_xml
self.complete_xml_element(xmlnode, doc1)
File "/home/karol/programowanie/pyxmpp/pyxmpp/jabber/dataforms.py", line 632, in complete_xml_element
xmlnode.newTextChild(ns, "title", self.title)
File "/usr/lib64/python2.3/site-packages/libxml2.py", line 3325, in newTextChild
ret = libxml2mod.xmlNewTextChild(self._o, ns__o, name, content)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u015b' in position 2: ordinal not in range(128)
}}}
Copy of the PyXMPP issue Jajcus/pyxmpp#14
Hi there,
I've done a small patch to pyxmpp-1.0.0.s20061212 to be able to open connections to jabber servers which use tls right from the beginning on port 5223 instead of doing starttls on port 5222. It's not as neat as I'd like it to be but it seems to work. :)
Hope it's of any use to you.
Copy of the PyXMPP issue Jajcus/pyxmpp#10
PyXMPP doesn't check the return code of socket.send (in streambase.py and streamtls.py) which could result in truncated data being sent to the server. See the documentation for socket.send: "Returns the number of bytes sent. Applications are responsible for checking that all data has been sent; if only some of the data was transmitted, the application needs to attempt delivery of the remaining data."
Copy of the PyXMPP issue Jajcus/pyxmpp#37
line 99 of echobot.py in the examples has a coding error
to see the error send a message to the id the bot logs on as then logout
run the bot and it will fail on line 99
Note: line 99 has no %s to be filled in with the variable
code should be changed from:
print u'Type: normal.' % (t,)
to
print u'Type: normal.',
Copy of the PyXMPP issue Jajcus/pyxmpp#4
Hi, we all know vcard-temp is bad and that the -temp wants to tell us something,no need for libxml2 to issue an annoying warning everytime it sees the namespace.
Copy of the PyXMPP issue Jajcus/pyxmpp#33
The following patch fixes these issues:
http://kolos.math.uni.lodz.pl/~grzywacz/pyxmpp_unicode.patch
Copy of the PyXMPP issue Jajcus/pyxmpp#15
After successfully registering a new user pyxmpp.jabber.clientstream.LegacyClientStream incorrectly sets self.password to be an instance of pyxmpp.jabber.dataforms.Field when it should be a string. Looks like the '.value' is missing. Patch attached.
Copy of the PyXMPP issue Jajcus/pyxmpp#26
I would like to simple include ''pyxmpp'' in my ''zc.buildout'' configs without defining the download URI in the ''dependency_links'' section. You guys already have a pypi account but do not provide a download link also your snapshot names seem to have no valid version string, could you change them to use svn revision numbers or something setuptools can understand?
Also would it be possible to include your dependencies in the ''install_requires'' section of the setup.py file? A patch for that is attached.
Copy of the PyXMPP issue Jajcus/pyxmpp#22
While minor, I have seen this test fail by "skipping" intermediate cache states which are expected to be visited during the test. To make the test completely reliable, we basically need to know the last "update time" for the cache item (expose the 'now' obtained in CacheItem.update_state), and make sure the clock difference corresponds to the correct cache state.
I'm attaching a sample diff for a new test and CacheItem which exposes the last cache update time (although we probably shouldn't change the internals just to get the test to pass reliably).
Copy of the PyXMPP issue Jajcus/pyxmpp#23
Hi,
I'm writing a simple client and I'm using an account on jabster.pl for testing. It seems however that check for the source JID in Client._roster_push is a little bit overzelous. The problem appears when one wants to connect to a specified resource name.
It raises ClientError exception which causes the roster push to fail and crashes the application (yes, I know it can be catched around loop_iter). The if check should look if the roster doesn't come from a substring of the JID or something.
The backtrace:
2009-03-03 21:57:38,302 DEBUG [streambase] IN: ""
2009-03-03 21:57:38,306 DEBUG [streamtls] OUT: '<default1:query xmlns="jabber:iq:roster" xmlns:default1="jabber:iq:roster"><default1:item subscription="none" jid="[email protected]"/>/default1:query'
Traceback (most recent call last):
File "/home/neuro/workspace/smoa-dev-node/src/smoa-dev-node.py", line 125, in
main()
File "/home/neuro/workspace/smoa-dev-node/src/smoa-dev-node.py", line 63, in main
core_obj.loop()
File "/home/neuro/workspace/smoa-dev-node/src/core/core.py", line 97, in loop
self.tmanager.iter_all()
File "/home/neuro/workspace/smoa-dev-node/src/core/transportmanager.py", line 45, in iter_all
obj.iter()
File "/home/neuro/workspace/smoa-dev-node/src/transport/xmpp.py", line 61, in iter
self._client.stream.loop_iter(1)
File "usr/lib/python2.6/site-packages/pyxmpp/streambase.py", line 598, in loop_iter
File "usr/lib/python2.6/site-packages/pyxmpp/streambase.py", line 616, in _loop_iter
File "usr/lib/python2.6/site-packages/pyxmpp/streamtls.py", line 179, in _process
File "usr/lib/python2.6/site-packages/pyxmpp/streambase.py", line 637, in _process
File "usr/lib/python2.6/site-packages/pyxmpp/streamtls.py", line 174, in _read
File "usr/lib/python2.6/site-packages/pyxmpp/streambase.py", line 661, in _read
File "usr/lib/python2.6/site-packages/pyxmpp/streambase.py", line 677, in _feed_reader
File "usr/lib/python2.6/site-packages/pyxmpp/xmlextra.py", line 537, in feed
File "usr/lib/python2.6/site-packages/pyxmpp/xmlextra.py", line 57, in _stanza
File "usr/lib/python2.6/site-packages/pyxmpp/streambase.py", line 401, in stanza
File "usr/lib/python2.6/site-packages/pyxmpp/stream.py", line 107, in _process_node
File "usr/lib/python2.6/site-packages/pyxmpp/streambase.py", line 710, in _process_node
File "usr/lib/python2.6/site-packages/pyxmpp/stanzaprocessor.py", line 271, in process_stanza
File "usr/lib/python2.6/site-packages/pyxmpp/stanzaprocessor.py", line 141, in process_iq
File "usr/lib/python2.6/site-packages/pyxmpp/client.py", line 346, in __roster_push
pyxmpp.exceptions.ClientError: Got roster update from wrong source
Copy of the PyXMPP issue Jajcus/pyxmpp#30
When I connected to jabber.org server(ejabberd server), the pyxmpp library can not handle rosters list. my suggestion :
change file pyxmpp\stanzaprocessor.py line 112:
'' elif ( (fr==self.peer or fr==self.me)''
to:
''elif ( (fr==self.peer or fr==self.me or fr.bare() == self.me.bare())''
will fix the bug.
Copy of the PyXMPP issue Jajcus/pyxmpp#28
PyXMPP2 should be also available for Python3.
There is still a problem with the DNSPython dependency (no official release for Python3), but this should not stop us.
The code will be developed for Python 2.7 with python3 in mind and converted using the 2to3 tool.
test
Copy of the PyXMPP issue Jajcus/pyxmpp#5
{{{
from pyxmpp.jabber.vcard import VCard, VCardName
v = VCard('')
n = VCardName('N', '')
n.given = 'Christopher; a semi-colon and a sentence, too.'
v.content['N'] = n
v.as_xml().serialize()
'\nChristopher; a semi-colon and a sentence, too.\n'
xml = [c for c in v.as_xml().children][0] #list comprehension to compensate for \nChristopher; a semi-colon and a sentence, too.Christopher; a semi-colon and a sentence, too.\n'
v.rfc2426()
'begin:VCARD\r\nversion:3.0\r\nn:;Christopher; a semi-colon and a sentence, too.;;;\r\nend:VCARD\r\n'
v3 = VCard(v.rfc2426())
Traceback (most recent call last):
File "", line 1, in
File "C:\workspace\lib\pyxmpp\jabber\vcard.py", line 1363, in init
self.n = None
File "C:\workspace\lib\pyxmpp\jabber\vcard.py", line 1477, in from_rfc2426
continue
File "C:\workspace\lib\pyxmpp\jabber\vcard.py", line 1508, in _process_rfc2425_record
if params:
File "C:\workspace\lib\pyxmpp\jabber\vcard.py", line 303, in __init
n=n.next
ValueError: too many values to unpack
}}}
since the semicolons are not backslash escaped, nor unescaped, string values with ';' in them cannot be handled properly.
a regex which can be used to properly split strings with escaped semicolons using a negative lookbehind assertion:
{{{non_quoted_semicolon_re=re.compile(r'(?<!);')}}}
I'll append patches and such as I finalize my fixes.
Copy of the PyXMPP issue Jajcus/pyxmpp#21
Client stream crashes after the stream is closed on error by the remote party:
DEBUG:pyxmpp.tcp.in:IN: ''
DEBUG:pyxmpp.streambase:Passing element <Element '{urn:ietf:params:xml:ns:xmpp-sasl}failure' at 0x837a10c> to method <bound method StreamSASLHandler._process_sasl_failure of <pyxmpp2.streamsasl.StreamSASLHandler object at 0x836c66c>>
DEBUG:pyxmpp.streamsasl:SASL authentication failed: '<ns0:failure xmlns:ns0="urn:ietf:params:xml:ns:xmpp-sasl"><ns0:not-authorized />/ns0:failure'
DEBUG:pyxmpp.transport:TCPTransport.disconnect()
DEBUG:pyxmpp.tcp.out:OUT: '/stream:stream'
DEBUG:pyxmpp.transport: _set_state('closing')
DEBUG:pyxmpp.transport:handle_read()
DEBUG:pyxmpp.transport:tls socket read...
DEBUG:pyxmpp.tcp.in:IN: '/stream:stream'
Traceback (most recent call last):
File "./simple_send_message.py", line 21, in
send_message(your_jid, your_password, target_jid, message)
File "/home/users/jajcus/git/pyxmpp2/examples/pyxmpp2/simple.py", line 132, in send_message
handler.disconnect()
File "/home/users/jajcus/git/pyxmpp2/examples/pyxmpp2/simple.py", line 58, in disconnect
self.client.run(timeout = 2)
File "/home/users/jajcus/git/pyxmpp2/examples/pyxmpp2/client.py", line 149, in run
self.mainloop.loop(timeout)
File "/home/users/jajcus/git/pyxmpp2/examples/pyxmpp2/mainloop/base.py", line 90, in loop
self.loop_iteration(interval)
File "/home/users/jajcus/git/pyxmpp2/examples/pyxmpp2/mainloop/poll.py", line 142, in loop_iteration
self._handlers[fileno].handle_read()
File "/home/users/jajcus/git/pyxmpp2/examples/pyxmpp2/transport.py", line 693, in handle_read
self._feed_reader(data)
File "/home/users/jajcus/git/pyxmpp2/examples/pyxmpp2/transport.py", line 797, in _feed_reader
self._reader.feed(data)
File "/home/users/jajcus/git/pyxmpp2/examples/pyxmpp2/xmppparser.py", line 216, in feed
self.handler.stream_parse_error(unicode(err))
File "/home/users/jajcus/git/pyxmpp2/examples/pyxmpp2/streambase.py", line 378, in stream_parse_error
raise StreamParseError(descr)
pyxmpp2.exceptions.StreamParseError: parsing finished: line 1, column 412
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.