timmerk / python-iptools

Automatically exported from code.google.com/p/python-iptools
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

long2ip does not handle range errors #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. long2ip(-1)
2. long2ip(374297346592387463875L)
3.

What is the expected output? What do you see instead?
expected: TypeError exception "out of range"
got: 1. '255.255.255.255'  2. '10.133.122.195'

What version of the product are you using? On what operating system?
Windows XP
python 2.6.4

Please provide any additional information below.
iptools.__init__.py:229
    if _MAX_IP < l < 0: 
        raise ...
I suppose there should be:
    if _MAX_IP < l or l < 0:

Original issue reported on code.google.com by AChi...@gmail.com on 16 May 2010 at 6:22

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r25.

Original comment by casadebender on 17 May 2010 at 3:14