AttributeError when attempting to access _sys.maxint

Bug #1421375 reported by Adam Stokes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-netaddr (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Fix Released
High
Unassigned

Bug Description

[Impact]
Anyone on Trusty wishing to utilize IPSets for gathering ranges of IPs.

[Test Case]
Code to reproduce:
from netaddr import IPSet
def get_ip_set(cidr):
    """ Returns a list of ip's in cidr for use in juju's no-proxy setting
    """
    ips = list(IPSet([cidr]))
    return ",".join(str(x) for x in ips)

get_ip_set('10.0.4.0/24')

[Regression Potentional]
None

[Other Info]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/share/openstack/cloudinstall/netutils.py", line 78, in get_ip_set
    ips = list(IPSet([cidr]))
  File "/usr/lib/python3/dist-packages/netaddr/ip/sets.py", line 518, in __len__
    if size > _sys.maxint:
AttributeError: 'module' object has no attribute 'maxint'

Revision history for this message
Adam Stokes (adam-stokes) wrote :
Changed in python-netaddr (Ubuntu Trusty):
importance: Undecided → High
milestone: none → ubuntu-14.04.2
tags: added: cloud-installer
Chris J Arges (arges)
Changed in python-netaddr (Ubuntu):
status: New → Fix Released
Revision history for this message
Chris J Arges (arges) wrote :

sponsored for trusty

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Adam, or anyone else affected,

Accepted python-netaddr into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-netaddr/0.7.10-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python-netaddr (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Adam Stokes (adam-stokes) wrote :

Tested with python3-netaddr 0.7.10-1ubuntu1.1

code:
In[2]:from netaddr import IPSet

In [3]: ",".join(str(x) for x in list(IPSet(['10.0.4.0/24'])))
Out[3]: '10.0.4.0,10.0.4.1,10.0.4.2,10.0.4.3,10.0.4.4,10.0.4.5,10.0.4.6,10.0.4.7,10.0.4.8,10.0.4.9,10.0.4.10,10.0.4.11,10.0.4.12,10.0.4.13,10.0.4.14,10.0.4.15,10.0.4.16,10.0.4.17,10.0.4.18,10.0.4.19,10.0.4.20,10.0.4.21,10.0.4.22,10.0.4.23,10.0.4.24,10.0.4.25,10.0.4.26,10.0.4.27,10.0.4.28,10.0.4.29,10.0.4.30,10.0.4.31,10.0.4.32,10.0.4.33,10.0.4.34,10.0.4.35,10.0.4.36,10.0.4.37,10.0.4.38,10.0.4.39,10.0.4.40,10.0.4.41,10.0.4.42,10.0.4.43,10.0.4.44,10.0.4.45,10.0.4.46,10.0.4.47,10.0.4.48,10.0.4.49,10.0.4.50,10.0.4.51,10.0.4.52,10.0.4.53,10.0.4.54,10.0.4.55,10.0.4.56,10.0.4.57,10.0.4.58,10.0.4.59,10.0.4.60,10.0.4.61,10.0.4.62,10.0.4.63,10.0.4.64,10.0.4.65,10.0.4.66,10.0.4.67,10.0.4.68,10.0.4.69,10.0.4.70,10.0.4.71,10.0.4.72,10.0.4.73,10.0.4.74,10.0.4.75,10.0.4.76,10.0.4.77,10.0.4.78,10.0.4.79,10.0.4.80,10.0.4.81,10.0.4.82,10.0.4.83,10.0.4.84,10.0.4.85,10.0.4.86,10.0.4.87,10.0.4.88,10.0.4.89,10.0.4.90,10.0.4.91,10.0.4.92,10.0.4.93,10.0.4.94,10.0.4.95,10.0.4.96,10.0.4.97,10.0.4.98,10.0.4.99,10.0.4.100,10.0.4.101,10.0.4.102,10.0.4.103,10.0.4.104,10.0.4.105,10.0.4.106,10.0.4.107,10.0.4.108,10.0.4.109,10.0.4.110,10.0.4.111,10.0.4.112,10.0.4.113,10.0.4.114,10.0.4.115,10.0.4.116,10.0.4.117,10.0.4.118,10.0.4.119,10.0.4.120,10.0.4.121,10.0.4.122,10.0.4.123,10.0.4.124,10.0.4.125,10.0.4.126,10.0.4.127,10.0.4.128,10.0.4.129,10.0.4.130,10.0.4.131,10.0.4.132,10.0.4.133,10.0.4.134,10.0.4.135,10.0.4.136,10.0.4.137,10.0.4.138,10.0.4.139,10.0.4.140,10.0.4.141,10.0.4.142,10.0.4.143,10.0.4.144,10.0.4.145,10.0.4.146,10.0.4.147,10.0.4.148,10.0.4.149,10.0.4.150,10.0.4.151,10.0.4.152,10.0.4.153,10.0.4.154,10.0.4.155,10.0.4.156,10.0.4.157,10.0.4.158,10.0.4.159,10.0.4.160,10.0.4.161,10.0.4.162,10.0.4.163,10.0.4.164,10.0.4.165,10.0.4.166,10.0.4.167,10.0.4.168,10.0.4.169,10.0.4.170,10.0.4.171,10.0.4.172,10.0.4.173,10.0.4.174,10.0.4.175,10.0.4.176,10.0.4.177,10.0.4.178,10.0.4.179,10.0.4.180,10.0.4.181,10.0.4.182,10.0.4.183,10.0.4.184,10.0.4.185,10.0.4.186,10.0.4.187,10.0.4.188,10.0.4.189,10.0.4.190,10.0.4.191,10.0.4.192,10.0.4.193,10.0.4.194,10.0.4.195,10.0.4.196,10.0.4.197,10.0.4.198,10.0.4.199,10.0.4.200,10.0.4.201,10.0.4.202,10.0.4.203,10.0.4.204,10.0.4.205,10.0.4.206,10.0.4.207,10.0.4.208,10.0.4.209,10.0.4.210,10.0.4.211,10.0.4.212,10.0.4.213,10.0.4.214,10.0.4.215,10.0.4.216,10.0.4.217,10.0.4.218,10.0.4.219,10.0.4.220,10.0.4.221,10.0.4.222,10.0.4.223,10.0.4.224,10.0.4.225,10.0.4.226,10.0.4.227,10.0.4.228,10.0.4.229,10.0.4.230,10.0.4.231,10.0.4.232,10.0.4.233,10.0.4.234,10.0.4.235,10.0.4.236,10.0.4.237,10.0.4.238,10.0.4.239,10.0.4.240,10.0.4.241,10.0.4.242,10.0.4.243,10.0.4.244,10.0.4.245,10.0.4.246,10.0.4.247,10.0.4.248,10.0.4.249,10.0.4.250,10.0.4.251,10.0.4.252,10.0.4.253,10.0.4.254,10.0.4.255'

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-netaddr - 0.7.10-1ubuntu1.1

---------------
python-netaddr (0.7.10-1ubuntu1.1) trusty-proposed; urgency=medium

  * netaddr/ip/sets.py:
    Fixes typo when accessing _sys_maxint (LP: #1421375)
 -- Adam Stokes <email address hidden> Thu, 12 Feb 2015 14:03:02 -0600

Changed in python-netaddr (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of the Stable Release Update for python-netaddr has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.