[Python-modules-commits] [python-amqp] 01/01: New upstream version 2.2.2
Michael Fladischer
fladi at moszumanska.debian.org
Wed Nov 1 17:25:47 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch upstream
in repository python-amqp.
commit afe52874b333d96cfdc261f54ce1f7f6d2ce31d4
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Wed Nov 1 17:46:29 2017 +0100
New upstream version 2.2.2
---
Changelog | 15 +++++++++++++++
PKG-INFO | 5 +++--
README.rst | 2 +-
amqp.egg-info/PKG-INFO | 5 +++--
amqp/__init__.py | 16 +---------------
amqp/abstract_channel.py | 14 --------------
amqp/basic_message.py | 14 --------------
amqp/channel.py | 14 --------------
amqp/connection.py | 14 --------------
amqp/exceptions.py | 14 --------------
amqp/method_framing.py | 26 +++++++-------------------
amqp/serialization.py | 22 ++++------------------
amqp/transport.py | 14 --------------
docs/includes/introduction.txt | 2 +-
t/unit/test_method_framing.py | 6 ++++++
15 files changed, 41 insertions(+), 142 deletions(-)
diff --git a/Changelog b/Changelog
index aa7d3ea..bae531b 100644
--- a/Changelog
+++ b/Changelog
@@ -5,6 +5,21 @@ py-amqp is fork of amqplib used by Kombu containing additional features and impr
The previous amqplib changelog is here:
http://code.google.com/p/py-amqplib/source/browse/CHANGES
+.. _version-2.2.2:
+
+2.2.2
+=====
+:release-date: 2017-09-14 09:00 A.M UTC+2
+:release-by: Omer Katz
+
+- Sending empty messages no longer hangs. Instead an empty message is sent correctly.(addresses #151)
+
+ Fix contributed by **Christian Blades**
+
+- Fixed compatibility issues in UTF-8 encoding behavior between Py2/Py3 (#164)
+
+ Fix contributed by **Tyler James Harden**
+
.. _version-2.2.1:
2.2.1
diff --git a/PKG-INFO b/PKG-INFO
index 16cdb4b..83194f2 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,18 +1,19 @@
Metadata-Version: 1.1
Name: amqp
-Version: 2.2.1
+Version: 2.2.2
Summary: Low-level AMQP client for Python (fork of amqplib).
Home-page: http://github.com/celery/py-amqp
Author: Ask Solem
Author-email: pyamqp at celeryproject.org
License: BSD
+Description-Content-Type: UNKNOWN
Description: =====================================================================
Python AMQP 0.9.1 client library
=====================================================================
|build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
- :Version: 2.2.1
+ :Version: 2.2.2
:Web: https://amqp.readthedocs.io/
:Download: http://pypi.python.org/pypi/amqp/
:Source: http://github.com/celery/py-amqp/
diff --git a/README.rst b/README.rst
index be83c65..025cac0 100644
--- a/README.rst
+++ b/README.rst
@@ -4,7 +4,7 @@
|build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
-:Version: 2.2.1
+:Version: 2.2.2
:Web: https://amqp.readthedocs.io/
:Download: http://pypi.python.org/pypi/amqp/
:Source: http://github.com/celery/py-amqp/
diff --git a/amqp.egg-info/PKG-INFO b/amqp.egg-info/PKG-INFO
index 16cdb4b..83194f2 100644
--- a/amqp.egg-info/PKG-INFO
+++ b/amqp.egg-info/PKG-INFO
@@ -1,18 +1,19 @@
Metadata-Version: 1.1
Name: amqp
-Version: 2.2.1
+Version: 2.2.2
Summary: Low-level AMQP client for Python (fork of amqplib).
Home-page: http://github.com/celery/py-amqp
Author: Ask Solem
Author-email: pyamqp at celeryproject.org
License: BSD
+Description-Content-Type: UNKNOWN
Description: =====================================================================
Python AMQP 0.9.1 client library
=====================================================================
|build-status| |coverage| |license| |wheel| |pyversion| |pyimp|
- :Version: 2.2.1
+ :Version: 2.2.2
:Web: https://amqp.readthedocs.io/
:Download: http://pypi.python.org/pypi/amqp/
:Source: http://github.com/celery/py-amqp/
diff --git a/amqp/__init__.py b/amqp/__init__.py
index 70bc07c..937a4ec 100644
--- a/amqp/__init__.py
+++ b/amqp/__init__.py
@@ -1,26 +1,12 @@
"""Low-level AMQP client for Python (fork of amqplib)."""
# Copyright (C) 2007-2008 Barry Pederson <bp at barryp.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
from __future__ import absolute_import, unicode_literals
import re
from collections import namedtuple
-__version__ = '2.2.1'
+__version__ = '2.2.2'
__author__ = 'Barry Pederson'
__maintainer__ = 'Ask Solem'
__contact__ = 'pyamqp at celeryproject.org'
diff --git a/amqp/abstract_channel.py b/amqp/abstract_channel.py
index 67032d8..aaad554 100644
--- a/amqp/abstract_channel.py
+++ b/amqp/abstract_channel.py
@@ -1,19 +1,5 @@
"""Code common to Connection and Channel objects."""
# Copyright (C) 2007-2008 Barry Pederson <bp at barryp.org>)
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
from __future__ import absolute_import, unicode_literals
from vine import ensure_promise, promise
diff --git a/amqp/basic_message.py b/amqp/basic_message.py
index 7f80df2..92089f7 100644
--- a/amqp/basic_message.py
+++ b/amqp/basic_message.py
@@ -1,19 +1,5 @@
"""AMQP Messages."""
# Copyright (C) 2007-2008 Barry Pederson <bp at barryp.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
from __future__ import absolute_import, unicode_literals
# Intended to fix #85: ImportError: cannot import name spec
diff --git a/amqp/channel.py b/amqp/channel.py
index f939e45..b16c6a8 100644
--- a/amqp/channel.py
+++ b/amqp/channel.py
@@ -1,19 +1,5 @@
"""AMQP Channels."""
# Copyright (C) 2007-2008 Barry Pederson <bp at barryp.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
from __future__ import absolute_import, unicode_literals
import logging
diff --git a/amqp/connection.py b/amqp/connection.py
index 2ed89fb..4bd86b7 100644
--- a/amqp/connection.py
+++ b/amqp/connection.py
@@ -1,19 +1,5 @@
"""AMQP Connections."""
# Copyright (C) 2007-2008 Barry Pederson <bp at barryp.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
from __future__ import absolute_import, unicode_literals
import logging
diff --git a/amqp/exceptions.py b/amqp/exceptions.py
index 94a7bba..f6e0403 100644
--- a/amqp/exceptions.py
+++ b/amqp/exceptions.py
@@ -1,19 +1,5 @@
"""Exceptions used by amqp."""
# Copyright (C) 2007-2008 Barry Pederson <bp at barryp.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
from __future__ import absolute_import, unicode_literals
from .five import python_2_unicode_compatible
from .platform import pack, unpack
diff --git a/amqp/method_framing.py b/amqp/method_framing.py
index 5ea46f9..28c1f4c 100644
--- a/amqp/method_framing.py
+++ b/amqp/method_framing.py
@@ -1,19 +1,5 @@
"""Convert between frames and higher-level AMQP methods."""
# Copyright (C) 2007-2008 Barry Pederson <bp at barryp.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
from __future__ import absolute_import, unicode_literals
from collections import defaultdict
@@ -159,7 +145,7 @@ def frame_writer(connection, transport,
pack_into('>BHI%dsB' % framelen, buf, offset,
type_, channel, framelen, frame, 0xce)
offset += 8 + framelen
- if body:
+ if body is not None:
frame = b''.join([
pack('>HHQ', method_sig[0], 0, len(body)),
properties,
@@ -170,10 +156,12 @@ def frame_writer(connection, transport,
2, channel, framelen, frame, 0xce)
offset += 8 + framelen
- framelen = len(body)
- pack_into('>BHI%dsB' % framelen, buf, offset,
- 3, channel, framelen, str_to_bytes(body), 0xce)
- offset += 8 + framelen
+ bodylen = len(body)
+ if bodylen > 0:
+ framelen = bodylen
+ pack_into('>BHI%dsB' % framelen, buf, offset,
+ 3, channel, framelen, str_to_bytes(body), 0xce)
+ offset += 8 + framelen
write(view[:offset])
diff --git a/amqp/serialization.py b/amqp/serialization.py
index 5ce3fb0..5ef508a 100644
--- a/amqp/serialization.py
+++ b/amqp/serialization.py
@@ -4,20 +4,6 @@
"""
# Copyright (C) 2007 Barry Pederson <bp at barryp.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
from __future__ import absolute_import, unicode_literals
import calendar
@@ -304,14 +290,14 @@ def dumps(format, values):
val = val or ''
bitcount = _flushbits(bits, write)
if isinstance(val, string):
- val = val.encode('utf-8')
+ val = val.encode('utf-8', 'surrogatepass')
write(pack('B', len(val)))
write(val)
elif p == 'S':
val = val or ''
bitcount = _flushbits(bits, write)
if isinstance(val, string):
- val = val.encode('utf-8')
+ val = val.encode('utf-8', 'surrogatepass')
write(pack('>I', len(val)))
write(val)
elif p == 'F':
@@ -332,7 +318,7 @@ def _write_table(d, write, bits, pack=pack):
twrite = out.write
for k, v in items(d):
if isinstance(k, string):
- k = k.encode('utf-8')
+ k = k.encode('utf-8', 'surrogatepass')
twrite(pack('B', len(k)))
twrite(k)
try:
@@ -366,7 +352,7 @@ def _write_item(v, write, bits, pack=pack,
None_t=None):
if isinstance(v, (string_t, bytes)):
if isinstance(v, string):
- v = v.encode('utf-8')
+ v = v.encode('utf-8', 'surrogatepass')
write(pack('>cI', b'S', len(v)))
write(v)
elif isinstance(v, bool):
diff --git a/amqp/transport.py b/amqp/transport.py
index 981c8b6..b1af3ae 100644
--- a/amqp/transport.py
+++ b/amqp/transport.py
@@ -1,19 +1,5 @@
"""Transport implementation."""
# Copyright (C) 2009 Barry Pederson <bp at barryp.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
from __future__ import absolute_import, unicode_literals
import errno
diff --git a/docs/includes/introduction.txt b/docs/includes/introduction.txt
index d88fce6..e80572d 100644
--- a/docs/includes/introduction.txt
+++ b/docs/includes/introduction.txt
@@ -1,4 +1,4 @@
-:Version: 2.2.1
+:Version: 2.2.2
:Web: https://amqp.readthedocs.io/
:Download: http://pypi.python.org/pypi/amqp/
:Source: http://github.com/celery/py-amqp/
diff --git a/t/unit/test_method_framing.py b/t/unit/test_method_framing.py
index a58053b..10204c2 100644
--- a/t/unit/test_method_framing.py
+++ b/t/unit/test_method_framing.py
@@ -99,3 +99,9 @@ class test_frame_writer:
frame = 2, 1, spec.Basic.Publish, b'x' * 10, msg
self.g(*frame)
self.write.assert_called()
+
+ def test_write_zero_len_body(self):
+ msg = Message(body=b'', content_type='application/octet-stream')
+ frame = 2, 1, spec.Basic.Publish, b'x' * 10, msg
+ self.g(*frame)
+ self.write.assert_called()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-amqp.git
More information about the Python-modules-commits
mailing list