-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix for IPv4 mapped IPv6 address changes in Python 3.13
- Loading branch information
1 parent
9f5532d
commit 71af0c5
Showing
3 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -533,7 +533,7 @@ | |
|
||
class info(): | ||
"""Provides parser metadata (version, author, etc.)""" | ||
version = '1.4' | ||
version = '1.5' | ||
description = 'IPv4 and IPv6 Address string parser' | ||
author = 'Kelly Brazil' | ||
author_email = '[email protected]' | ||
|
@@ -661,8 +661,18 @@ def parse( | |
|
||
if interface.version == 4: | ||
ip_split = ip_exploded.split('.') | ||
|
||
else: | ||
ip_split = ip_exploded.split(':') | ||
# regular IPv6 | ||
if not '.' in ip_exploded: | ||
ip_split = ip_exploded.split(':') | ||
|
||
# IPv4 mapped IPv6 | ||
else: | ||
ip_split_v6 = ip_exploded.split(':')[:-1] | ||
ip_split_v4_mapped_str = ip_exploded.split(':')[-1] | ||
ip_split_v4_mapped = ip_split_v4_mapped_str.split('.') | ||
ip_split = ip_split_v6 + ip_split_v4_mapped | ||
|
||
# fix for ipv6-only attributes | ||
scope_id = None | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters