News for hackers. Stuff that matters.
Re:Potholes to avoid when migrating to IPv6 by anderskaseorg on Monday December 31, 2018 @03:04AM (#18793597)
See also rsplit(':', 1). But instead of either of those, you should really be using library functions that already understand the format in question instead of making up your own rules.

  >>> u = urllib.parse.ParseResult('', '[2001:0db8:f00f::0553:1211:0088]:10443', '', '', '', '')
  >>> u.hostname
  '2001:0db8:f00f::0553:1211:0088'
  >>> ipaddress.ip_address(u.hostname)
  IPv6Address('2001:db8:f00f::553:1211:88')
  >>> u.port
  10443
Re:Potholes to avoid when migrating to IPv6 by ggm on Monday December 31, 2018 @06:04AM (#18794040)
Urllib? There has to be a better choice than that. I've been using inet_ntop and pton to canonically convert bare IPs in to sane forms.
Re:Potholes to avoid when migrating to IPv6 by detaro on Monday December 31, 2018 @06:05AM (#18794044)
What's the problem with urllib for this purpose?