Issue 58 in netaddr: IPSet operations should accept the same arguments as IPAddress

2 views
Skip to first unread message

codesite...@google.com

unread,
Aug 27, 2010, 7:02:47 AM8/27/10
to net...@googlegroups.com
Status: New
Owner: drkjam
Labels: Type-Enhancement Priority-Medium

New issue 58 by drkjam: IPSet operations should accept the same arguments
as IPAddress
http://code.google.com/p/netaddr/issues/detail?id=58

*Raised by Stefan Nordhausen via email*

What steps will reproduce the problem?

>>> from netaddr import *
>>> x=IPSet()
>>> x.add(1234)

What is the expected output?

IPSet(['0.0.4.210/32'])

What do you see instead?

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib64/python2.6/site-packages/netaddr/ip/sets.py", line
111, in add
self._cidrs[IPNetwork(ip)] = True
File "/usr/local/lib64/python2.6/site-packages/netaddr/ip/__init__.py",
line 687, in __init__
prefix, suffix = addr.split('/')
AttributeError: 'int' object has no attribute 'split'

Is there a workaround?

>>> x.add(IPAddress(1234))

What version of the product are you using?

netaddr 0.7.3

On what operating system?

Linux 64-bit

Please provide any additional information below.

I think the IPSet should accept everything that IPAddress accepts.


codesite...@google.com

unread,
Sep 13, 2010, 10:14:05 AM9/13/10
to net...@googlegroups.com
Updates:
Status: Accepted

Comment #1 on issue 58 by drkjam: IPSet operations should accept the same

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages