Windows 8 error to run app.py

93 views
Skip to first unread message

Faustino Aguilar Quirós

unread,
Jun 15, 2013, 2:05:30 PM6/15/13
to we...@googlegroups.com
Fixed Code
In Windows 8 to work the app.py:
net.py line :33
try:
socket.inet_pton(socket.AF_INET6, address)
except socket.error:
return False

And Ok!
if I put "return True", I have an error:
AttributeError: 'module' object has no attribute 'inet_pton'
 
Original code:
def validip6addr(address):
    """
Returns True if `address` is a valid IPv6 address.

>>> validip6addr('::')
True
>>> validip6addr('aaaa:bbbb:cccc:dddd::1')
True
>>> validip6addr('1:2:3:4:5:6:7:8:9:10')
False
>>> validip6addr('12:10')
False
"""
    try:
        socket.inet_pton(socket.AF_INET6, address)
    except socket.error:
        return False

    return True

xiaole jianjian

unread,
Jul 9, 2013, 3:20:51 AM7/9/13
to we...@googlegroups.com
I also encounter this problem . 
I move to linux .

Paul Wells

unread,
Jul 16, 2013, 1:55:30 AM7/16/13
to we...@googlegroups.com
In net.py I have this:
 
def validipaddr(address):
    """
    Returns True if `address` is a valid IPv4 address.
   
        >>> validipaddr('192.168.1.1')
        True
        >>> validipaddr('192.168.1.800')
        False
        >>> validipaddr('192.168.1')
        False
    """
    try:
        octets = address.split('.')
        if len(octets) != 4:
            return False
        for x in octets:
            if not (0 <= int(x) <= 255): <== This is line 33
                return False
    except ValueError:
        return False
    return True
 
Should I insert your code at this point?

Faustino Aguilar Quirós

unread,
Jul 19, 2013, 3:07:11 PM7/19/13
to we...@googlegroups.com
I too

:-)
Reply all
Reply to author
Forward
0 new messages