Control: tags 802146 + patch Control: tags 802146 + pending Dear maintainer,
I've prepared an NMU for python-nbxmpp (versioned as 0.5.3-0.1) and uploaded it to DELAYED/7. Please feel free to tell me if I should delay it longer. Regards, Filip
diff -Nru python-nbxmpp-0.5.1/ChangeLog python-nbxmpp-0.5.3/ChangeLog --- python-nbxmpp-0.5.1/ChangeLog 2014-10-04 22:02:36.000000000 +0200 +++ python-nbxmpp-0.5.3/ChangeLog 2015-07-16 21:07:45.000000000 +0200 @@ -1,3 +1,15 @@ +python-nbxmpp 0.5.3 (13 July 2015) + + * Fix receiving long utf8 strings under py3 + * Fix issue with pyopenssl 0.15.1 + * Fix decoding issues + +python-nbxmpp 0.5.2 (27 December 2014) + + * Fix BOSH HTTP requests + * Fix handling of binary SASL data for mechanism GSSAPI + * Update MAM namespace + python-nbxmpp 0.5.1 (04 October 2014) * Fix printing network errors in a non-utf-8 console diff -Nru python-nbxmpp-0.5.1/debian/changelog python-nbxmpp-0.5.3/debian/changelog --- python-nbxmpp-0.5.1/debian/changelog 2014-10-16 09:17:41.000000000 +0200 +++ python-nbxmpp-0.5.3/debian/changelog 2015-12-26 17:00:07.000000000 +0100 @@ -1,3 +1,10 @@ +python-nbxmpp (0.5.3-0.1) unstable; urgency=medium + + * New upstream version + * Require python3-gi for successful test run; closes: #802146 + + -- Filip Pytloun <fi...@pytloun.cz> Sat, 26 Dec 2015 16:33:02 +0100 + python-nbxmpp (0.5.1-2) unstable; urgency=medium * Build for python2 and python3 (thanks to W. Martin Borgert for notifying diff -Nru python-nbxmpp-0.5.1/debian/control python-nbxmpp-0.5.3/debian/control --- python-nbxmpp-0.5.1/debian/control 2014-10-16 09:26:23.000000000 +0200 +++ python-nbxmpp-0.5.3/debian/control 2015-12-26 16:41:30.000000000 +0100 @@ -2,7 +2,7 @@ Section: python Priority: optional Maintainer: Tanguy Ortolo <tanguy+deb...@ortolo.eu> -Build-Depends: debhelper (>= 9), dh-python, python-all, python3-all +Build-Depends: debhelper (>= 9), dh-python, python-all, python3-all, python3-gi Standards-Version: 3.9.6 Homepage: https://python-nbxmpp.gajim.org/ Vcs-Git: git://git.ortolo.eu/pkg-python-nbxmpp.git diff -Nru python-nbxmpp-0.5.1/debian/patches/fix-raise-statements.patch python-nbxmpp-0.5.3/debian/patches/fix-raise-statements.patch --- python-nbxmpp-0.5.1/debian/patches/fix-raise-statements.patch 2014-10-16 09:17:41.000000000 +0200 +++ python-nbxmpp-0.5.3/debian/patches/fix-raise-statements.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,60 +0,0 @@ -Description: Fix some raise statements so they are compatible with Python 3 - Some raise statement were written in a legacy form that was incompatible with - Python 3. This patch fixes that by using the new syntax. -Author: Tanguy Ortolo <tanguy+deb...@ortolo.eu> -Forwarded: https://python-nbxmpp.gajim.org/ticket/28 -Last-Update: 2014-10-15 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ -Index: pkg-python-nbxmpp/nbxmpp/xmpp_stringprep.py -=================================================================== ---- pkg-python-nbxmpp.orig/nbxmpp/xmpp_stringprep.py 2014-10-15 21:59:43.661759422 +0200 -+++ pkg-python-nbxmpp/nbxmpp/xmpp_stringprep.py 2014-10-15 23:01:30.664462612 +0200 -@@ -133,12 +133,12 @@ - for c in string: - for table in self.prohibiteds: - if table.lookup(c): -- raise UnicodeError, "Invalid character %s" % repr(c) -+ raise UnicodeError("Invalid character %s" % repr(c)) - - def check_unassigneds(self, string): - for c in string: - if stringprep.in_table_a1(c): -- raise UnicodeError, "Unassigned code point %s" % repr(c) -+ raise UnicodeError("Unassigned code point %s" % repr(c)) - - def check_bidirectionals(self, string): - found_LCat = False -@@ -151,11 +151,11 @@ - found_LCat = True - - if found_LCat and found_RandALCat: -- raise UnicodeError, "Violation of BIDI Requirement 2" -+ raise UnicodeError( "Violation of BIDI Requirement 2") - - if found_RandALCat and not (stringprep.in_table_d1(string[0]) and - stringprep.in_table_d1(string[-1])): -- raise UnicodeError, "Violation of BIDI Requirement 3" -+ raise UnicodeError("Violation of BIDI Requirement 3") - - - class NamePrep: -@@ -206,15 +206,15 @@ - def check_prohibiteds(self, string): - for c in string: - if c in self.prohibiteds: -- raise UnicodeError, "Invalid character %s" % repr(c) -+ raise UnicodeError("Invalid character %s" % repr(c)) - - def nameprep(self, label): - label = idna.nameprep(label) - self.check_prohibiteds(label) - if label[0] == '-': -- raise UnicodeError, "Invalid leading hyphen-minus" -+ raise UnicodeError("Invalid leading hyphen-minus") - if label[-1] == '-': -- raise UnicodeError, "Invalid trailing hyphen-minus" -+ raise UnicodeError("Invalid trailing hyphen-minus") - return label - - diff -Nru python-nbxmpp-0.5.1/debian/patches/series python-nbxmpp-0.5.3/debian/patches/series --- python-nbxmpp-0.5.1/debian/patches/series 2014-10-16 09:17:41.000000000 +0200 +++ python-nbxmpp-0.5.3/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -fix-raise-statements.patch diff -Nru python-nbxmpp-0.5.1/nbxmpp/auth_nb.py python-nbxmpp-0.5.3/nbxmpp/auth_nb.py --- python-nbxmpp-0.5.1/nbxmpp/auth_nb.py 2014-04-24 21:32:10.000000000 +0200 +++ python-nbxmpp-0.5.3/nbxmpp/auth_nb.py 2015-06-14 14:26:56.000000000 +0200 @@ -301,7 +301,11 @@ split('\n')) incoming_data = challenge.getData() - data=base64.b64decode(incoming_data.encode('utf-8')).decode('utf-8') + data=base64.b64decode(incoming_data.encode('utf-8')) + + if self.mechanism != 'GSSAPI': + data=data.decode('utf-8') + ### Handle Auth result def on_auth_fail(reason): log.info('Failed SASL authentification: %s' % reason) @@ -352,7 +356,10 @@ raise NodeProcessed ### Perform auth step - log.info('Got challenge:' + data) + if self.mechanism != 'GSSAPI': + log.info('Got challenge:' + data) + else: + log.info('Got challenge') if self.mechanism == 'GSSAPI': if self.gss_step == GSS_STATE_STEP: @@ -415,7 +422,7 @@ r = 'c=' + scram_base64(self.scram_gs2) else: # Channel binding data goes in here too. - r = 'c=' + scram_base64(self.scram_gs2 + r = 'c=' + scram_base64(bytes(self.scram_gs2) + self.channel_binding) r += ',r=' + data['r'] self.scram_soup += r diff -Nru python-nbxmpp-0.5.1/nbxmpp/client_nb.py python-nbxmpp-0.5.3/nbxmpp/client_nb.py --- python-nbxmpp-0.5.1/nbxmpp/client_nb.py 2014-04-09 17:33:08.000000000 +0200 +++ python-nbxmpp-0.5.3/nbxmpp/client_nb.py 2015-03-17 20:32:43.000000000 +0100 @@ -150,7 +150,7 @@ def connect(self, on_connect, on_connect_failure, hostname=None, port=5222, on_proxy_failure=None, on_stream_error_cb=None, proxy=None, - secure_tuple=('tls', None, None, None)): + secure_tuple=('tls', None, None, None, None)): """ Open XMPP connection (open XML streams in both directions) diff -Nru python-nbxmpp-0.5.1/nbxmpp/__init__.py python-nbxmpp-0.5.3/nbxmpp/__init__.py --- python-nbxmpp-0.5.1/nbxmpp/__init__.py 2014-10-04 22:01:23.000000000 +0200 +++ python-nbxmpp-0.5.3/nbxmpp/__init__.py 2015-07-16 21:05:50.000000000 +0200 @@ -17,4 +17,4 @@ from .plugin import PlugIn from .smacks import Smacks -__version__ = "0.5.1" +__version__ = "0.5.3" diff -Nru python-nbxmpp-0.5.1/nbxmpp/protocol.py python-nbxmpp-0.5.3/nbxmpp/protocol.py --- python-nbxmpp-0.5.1/nbxmpp/protocol.py 2014-04-24 21:27:35.000000000 +0200 +++ python-nbxmpp-0.5.3/nbxmpp/protocol.py 2014-12-29 14:48:29.000000000 +0100 @@ -100,7 +100,7 @@ NS_JINGLE_IBB = 'urn:xmpp:jingle:transports:ibb:1' # XEP-0261 NS_LAST = 'jabber:iq:last' NS_LOCATION = 'http://jabber.org/protocol/geoloc' # XEP-0080 -NS_MAM = 'urn:xmpp:mam:tmp' # XEP-0313 +NS_MAM = 'urn:xmpp:mam:0' # XEP-0313 NS_MESSAGE = 'message' # Jabberd2 NS_MOOD = 'http://jabber.org/protocol/mood' # XEP-0107 NS_MUC = 'http://jabber.org/protocol/muc' diff -Nru python-nbxmpp-0.5.1/nbxmpp/roster_nb.py python-nbxmpp-0.5.3/nbxmpp/roster_nb.py --- python-nbxmpp-0.5.1/nbxmpp/roster_nb.py 2014-04-09 17:32:20.000000000 +0200 +++ python-nbxmpp-0.5.3/nbxmpp/roster_nb.py 2015-05-10 14:45:29.000000000 +0200 @@ -242,16 +242,16 @@ """ Rename multiple contacts and sets their group lists """ - iq = Iq('set', NS_ROSTER) - query = iq.getTag('query') for i in items: + iq = Iq('set', NS_ROSTER) + query = iq.getTag('query') attrs = {'jid': i['jid']} if i['name']: attrs['name'] = i['name'] item = query.setTag('item', attrs) for group in i['groups']: item.addChild(node=Node('group', payload=[group])) - self._owner.send(iq) + self._owner.send(iq) def getItems(self): """ diff -Nru python-nbxmpp-0.5.1/nbxmpp/transports_nb.py python-nbxmpp-0.5.3/nbxmpp/transports_nb.py --- python-nbxmpp-0.5.1/nbxmpp/transports_nb.py 2014-10-04 22:18:57.000000000 +0200 +++ python-nbxmpp-0.5.3/nbxmpp/transports_nb.py 2015-07-16 21:07:52.000000000 +0200 @@ -37,6 +37,7 @@ import time import traceback import base64 +import sys import locale try: @@ -83,6 +84,15 @@ proxy_user, proxy_pass = proxy['user'], proxy['pass'] return tcp_host, tcp_port, proxy_user, proxy_pass +def decode_py2(string, encoding): + # decodes string into unicode if in py2 + # py3 has unicode strings by default + try: + string = string.decode(encoding) + except AttributeError: + pass + return string + #: timeout to connect to the server socket, it doesn't include auth CONNECT_TIMEOUT_SECONDS = 30 @@ -370,8 +380,8 @@ self._sock.setblocking(False) self._sock.connect((self.server, self.port)) except Exception as exc: - errnum, errstr = exc.errno,\ - exc.strerror.decode(locale.getpreferredencoding()) + errnum, errstr = exc.errno, \ + decode_py2(exc.strerror, locale.getpreferredencoding()) if errnum in (errno.EINPROGRESS, errno.EALREADY, errno.EWOULDBLOCK): # connecting in progress @@ -474,7 +484,7 @@ self._sock.shutdown(socket.SHUT_RDWR) self._sock.close() except socket.error as e: - errstr = e.strerror.decode(locale.getpreferredencoding()) + errstr = decode_py2(e.strerror, locale.getpreferredencoding()) log.info('Error while disconnecting socket: %s' % errstr) self.fd = -1 NonBlockingTransport.disconnect(self, do_callback) @@ -558,7 +568,7 @@ return None self.sendbuff = self.sendqueue.pop(0) try: - send_count = self._send(self.sendbuff.encode("utf-8")) + send_count = self._send(self.sendbuff) if send_count: sent_data = self.sendbuff[:send_count] self.sendbuff = self.sendbuff[send_count:] @@ -569,7 +579,7 @@ self.sent_bytes_buff = b'' # try to decode sent data try: - sent_data = sent_data.decode('utf-8') + sent_data = decode_py2(sent_data, 'utf-8') except UnicodeDecodeError: for i in range(-1, -4, -1): char = sent_data[i] @@ -577,7 +587,7 @@ self.sent_bytes_buff = sent_data[i:] sent_data = sent_data[:i] break - sent_data = sent_data.decode('utf-8') + sent_data = decode_py2(sent_data, 'utf-8') self.raise_event(DATA_SENT, sent_data) except Exception: @@ -603,7 +613,7 @@ log.info("_do_receive, caught SSL error, got %s:" % received, exc_info=True) errnum, errstr = e.errno,\ - e.strerror.decode(locale.getpreferredencoding()) + decode_py2(e.strerror, locale.getpreferredencoding()) if received == '': errstr = 'zero bytes on recv' @@ -639,15 +649,17 @@ # try to decode data try: - received = received.decode('utf-8') + received = decode_py2(received, 'utf-8') except UnicodeDecodeError: for i in range(-1, -4, -1): char = received[i] - if ord(char) & 0xc0 == 0xc0: + if sys.version_info[0] < 3: # with py2 we get a str + char = ord(char) + if char & 0xc0 == 0xc0: self.received_bytes_buff = received[i:] received = received[:i] break - received = received.decode('utf-8') + received = decode_py2(received, 'utf-8') # pass received data to owner if self.on_receive: @@ -766,9 +778,7 @@ Builds http message with given body. Values for headers and status line fields are taken from class variables """ - absolute_uri = '%s://%s:%s%s' % (self.http_protocol, self.http_host, - self.http_port, self.http_path) - headers = ['%s %s %s' % (method, absolute_uri, self.http_version), + headers = ['%s %s %s' % (method, self.http_path, self.http_version), 'Host: %s:%s' % (self.http_host, self.http_port), 'User-Agent: Gajim', 'Content-Type: text/xml; charset=utf-8', diff -Nru python-nbxmpp-0.5.1/nbxmpp/xmpp_stringprep.py python-nbxmpp-0.5.3/nbxmpp/xmpp_stringprep.py --- python-nbxmpp-0.5.1/nbxmpp/xmpp_stringprep.py 2014-09-26 22:58:40.000000000 +0200 +++ python-nbxmpp-0.5.3/nbxmpp/xmpp_stringprep.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,246 +0,0 @@ -# -*- test-case-name: twisted.words.test.test_jabberxmppstringprep -*- -# -# Copyright (c) Twisted Matrix Laboratories. -# See LICENSE for details. - -import stringprep -from encodings import idna - -# We require Unicode version 3.2. -from unicodedata import ucd_3_2_0 as unicodedata - -from twisted.python.versions import Version -from twisted.python.deprecate import deprecatedModuleAttribute - -from zope.interface import Interface, implements - - -crippled = False -deprecatedModuleAttribute( - Version("Twisted", 13, 1, 0), - "crippled is always False", - __name__, - "crippled") - - - -class ILookupTable(Interface): - """ - Interface for character lookup classes. - """ - - def lookup(c): - """ - Return whether character is in this table. - """ - - - -class IMappingTable(Interface): - """ - Interface for character mapping classes. - """ - - def map(c): - """ - Return mapping for character. - """ - - - -class LookupTableFromFunction: - - implements(ILookupTable) - - def __init__(self, in_table_function): - self.lookup = in_table_function - - - -class LookupTable: - - implements(ILookupTable) - - def __init__(self, table): - self._table = table - - def lookup(self, c): - return c in self._table - - - -class MappingTableFromFunction: - - implements(IMappingTable) - - def __init__(self, map_table_function): - self.map = map_table_function - - - -class EmptyMappingTable: - - implements(IMappingTable) - - def __init__(self, in_table_function): - self._in_table_function = in_table_function - - def map(self, c): - if self._in_table_function(c): - return None - else: - return c - - - -class Profile: - def __init__(self, mappings=[], normalize=True, prohibiteds=[], - check_unassigneds=True, check_bidi=True): - self.mappings = mappings - self.normalize = normalize - self.prohibiteds = prohibiteds - self.do_check_unassigneds = check_unassigneds - self.do_check_bidi = check_bidi - - def prepare(self, string): - result = self.map(string) - if self.normalize: - result = unicodedata.normalize("NFKC", result) - self.check_prohibiteds(result) - if self.do_check_unassigneds: - self.check_unassigneds(result) - if self.do_check_bidi: - self.check_bidirectionals(result) - return result - - def map(self, string): - result = [] - - for c in string: - result_c = c - - for mapping in self.mappings: - result_c = mapping.map(c) - if result_c != c: - break - - if result_c is not None: - result.append(result_c) - - return u"".join(result) - - def check_prohibiteds(self, string): - for c in string: - for table in self.prohibiteds: - if table.lookup(c): - raise UnicodeError, "Invalid character %s" % repr(c) - - def check_unassigneds(self, string): - for c in string: - if stringprep.in_table_a1(c): - raise UnicodeError, "Unassigned code point %s" % repr(c) - - def check_bidirectionals(self, string): - found_LCat = False - found_RandALCat = False - - for c in string: - if stringprep.in_table_d1(c): - found_RandALCat = True - if stringprep.in_table_d2(c): - found_LCat = True - - if found_LCat and found_RandALCat: - raise UnicodeError, "Violation of BIDI Requirement 2" - - if found_RandALCat and not (stringprep.in_table_d1(string[0]) and - stringprep.in_table_d1(string[-1])): - raise UnicodeError, "Violation of BIDI Requirement 3" - - -class NamePrep: - """ Implements preparation of internationalized domain names. - - This class implements preparing internationalized domain names using the - rules defined in RFC 3491, section 4 (Conversion operations). - - We do not perform step 4 since we deal with unicode representations of - domain names and do not convert from or to ASCII representations using - punycode encoding. When such a conversion is needed, the C{idna} standard - library provides the C{ToUnicode()} and C{ToASCII()} functions. Note that - C{idna} itself assumes UseSTD3ASCIIRules to be false. - - The following steps are performed by C{prepare()}: - - - Split the domain name in labels at the dots (RFC 3490, 3.1) - - Apply nameprep proper on each label (RFC 3491) - - Enforce the restrictions on ASCII characters in host names by - assuming STD3ASCIIRules to be true. (STD 3) - - Rejoin the labels using the label separator U+002E (full stop). - - """ - - # Prohibited characters. - prohibiteds = [unichr(n) for n in range(0x00, 0x2c + 1) + - range(0x2e, 0x2f + 1) + - range(0x3a, 0x40 + 1) + - range(0x5b, 0x60 + 1) + - range(0x7b, 0x7f + 1) ] - - def prepare(self, string): - result = [] - - labels = idna.dots.split(string) - - if labels and len(labels[-1]) == 0: - trailing_dot = '.' - del labels[-1] - else: - trailing_dot = '' - - for label in labels: - result.append(self.nameprep(label)) - - return ".".join(result) + trailing_dot - - def check_prohibiteds(self, string): - for c in string: - if c in self.prohibiteds: - raise UnicodeError, "Invalid character %s" % repr(c) - - def nameprep(self, label): - label = idna.nameprep(label) - self.check_prohibiteds(label) - if label[0] == '-': - raise UnicodeError, "Invalid leading hyphen-minus" - if label[-1] == '-': - raise UnicodeError, "Invalid trailing hyphen-minus" - return label - - -C_11 = LookupTableFromFunction(stringprep.in_table_c11) -C_12 = LookupTableFromFunction(stringprep.in_table_c12) -C_21 = LookupTableFromFunction(stringprep.in_table_c21) -C_22 = LookupTableFromFunction(stringprep.in_table_c22) -C_3 = LookupTableFromFunction(stringprep.in_table_c3) -C_4 = LookupTableFromFunction(stringprep.in_table_c4) -C_5 = LookupTableFromFunction(stringprep.in_table_c5) -C_6 = LookupTableFromFunction(stringprep.in_table_c6) -C_7 = LookupTableFromFunction(stringprep.in_table_c7) -C_8 = LookupTableFromFunction(stringprep.in_table_c8) -C_9 = LookupTableFromFunction(stringprep.in_table_c9) - -B_1 = EmptyMappingTable(stringprep.in_table_b1) -B_2 = MappingTableFromFunction(stringprep.map_table_b2) - -nodeprep = Profile(mappings=[B_1, B_2], - prohibiteds=[C_11, C_12, C_21, C_22, - C_3, C_4, C_5, C_6, C_7, C_8, C_9, - LookupTable([u'"', u'&', u"'", u'/', - u':', u'<', u'>', u'@'])]) - -resourceprep = Profile(mappings=[B_1,], - prohibiteds=[C_12, C_21, C_22, - C_3, C_4, C_5, C_6, C_7, C_8, C_9]) - -nameprep = NamePrep() diff -Nru python-nbxmpp-0.5.1/PKG-INFO python-nbxmpp-0.5.3/PKG-INFO --- python-nbxmpp-0.5.1/PKG-INFO 2014-10-04 22:19:22.000000000 +0200 +++ python-nbxmpp-0.5.3/PKG-INFO 2015-07-16 21:10:36.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: nbxmpp -Version: 0.5.1 +Version: 0.5.3 Summary: Non blocking Jabber/XMPP module Home-page: http://python-nbxmpp.gajim.org Author: Yann Leboulanger diff -Nru python-nbxmpp-0.5.1/setup.py python-nbxmpp-0.5.3/setup.py --- python-nbxmpp-0.5.1/setup.py 2014-10-04 22:03:57.000000000 +0200 +++ python-nbxmpp-0.5.3/setup.py 2015-07-16 21:05:58.000000000 +0200 @@ -3,7 +3,7 @@ from distutils.core import setup setup(name='nbxmpp', - version='0.5.1', + version='0.5.3', description='Non blocking Jabber/XMPP module', author='Yann Leboulanger', author_email='aste...@lagaule.org',
signature.asc
Description: Digital signature