Python Forum
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ipaddress.IPv4Network
#5
It raises an exception at the first IP address that's not a network (p.s. f2 is defined before. It's the file. It contains either a username, IP address or IP address with a range. I want only the IP addresses and IP addresses with ranges.

Error:

Traceback (most recent call last):
File "E:\Data\Languages\French\test\block.py", line 20, in <module>
net = ipaddress.IPv4Network(line[2])
AttributeError: 'IPv4Address' object has no attribute 'IPv4Network'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\Data\Languages\French\test\block.py", line 21, in <module>
except ipaddress.AddressValueError:
AttributeError: 'IPv4Address' object has no attribute 'AddressValueError'
Reply


Messages In This Thread
ipaddress.IPv4Network - by tomthirteen - Dec-17-2018, 08:18 PM
RE: ipaddress.IPv4Network - by buran - Dec-17-2018, 08:24 PM
RE: ipaddress.IPv4Network - by tomthirteen - Dec-17-2018, 08:37 PM
RE: ipaddress.IPv4Network - by buran - Dec-17-2018, 09:00 PM
RE: ipaddress.IPv4Network - by tomthirteen - Dec-17-2018, 09:08 PM
RE: ipaddress.IPv4Network - by buran - Dec-17-2018, 09:27 PM
RE: ipaddress.IPv4Network - by tomthirteen - Dec-17-2018, 09:31 PM
RE: ipaddress.IPv4Network - by buran - Dec-17-2018, 09:33 PM
RE: ipaddress.IPv4Network - by tomthirteen - Dec-17-2018, 09:51 PM
RE: ipaddress.IPv4Network - by buran - Dec-18-2018, 08:01 AM
RE: ipaddress.IPv4Network - by buran - Dec-18-2018, 08:58 AM
RE: ipaddress.IPv4Network - by tomthirteen - Jan-08-2019, 10:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  help with ipaddress package jcrubaugh45 5 1,665 Jul-13-2022, 02:19 PM
Last Post: jcrubaugh45

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020