Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 457956

Summary: dev-python/py-amqp-1.0.6-r1: broken with python3*
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Corentin Chary (RETIRED) <iksaif>
Status: RESOLVED FIXED    
Severity: normal CC: esigra, python, tdalman
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 292402    
Attachments: Build log with python3.3

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-02-17 12:55:33 UTC
Created attachment 339140 [details]
Build log with python3.3

With python3.2, the tests fail with the following errors:

ERROR: test_table (test_serialization.TestSerialization)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/portage/dev-python/py-amqp-1.0.6-r1/work/amqp-1.0.6-python3_3/funtests/test_serialization.py", line 304, in test_table
    w.write_table(val)
  File "/tmp/portage/dev-python/py-amqp-1.0.6-r1/work/amqp-1.0.6-python3_3/lib/amqp/serialization.py", line 300, in write_table
    table_data.write(pack('>ci', 'I', v))
struct.error: char format requires a bytes object of length 1

and a few similar ones.


Additionally, if you run the tests by hand (not omitting socket tests), you'd notice that error handling is broken in py3;

ERROR: test_with (test_with.TestChannel)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/amqp-1.0.6/funtests/test_with.py", line 33, in test_with
    with Connection(**settings.connect_args) as conn:
  File "/tmp/amqp-1.0.6/build/lib/amqp/connection.py", line 146, in __init__
    self.transport = create_transport(host, connect_timeout, ssl)
  File "/tmp/amqp-1.0.6/build/lib/amqp/transport.py", line 243, in create_transport
    return TCPTransport(host, connect_timeout)
  File "/tmp/amqp-1.0.6/build/lib/amqp/transport.py", line 89, in __init__
    raise socket.error(msg)
UnboundLocalError: local variable 'msg' referenced before assignment

and similar ones.

I will restrict python3 support in the -r1 ebuild.
Comment 1 Tolga Dalman 2013-05-03 10:27:15 UTC
Could you try py-amqp-1.1.0 ? It should have been fixed as per https://github.com/celery/py-amqp/blob/master/Changelog.
Comment 2 Patrick Lauer gentoo-dev 2014-03-12 05:15:46 UTC
New version doesn't do that anymore