Skip to content

ipaddress._BaseAddress has no attribute _string_from_ip_int #102366

@narel

Description

@narel

Bug report

ipaddress._BaseAddress class has no _string_from_ip_int attribute, but it is used in __str__ method:

>>> from ipaddress import _BaseAddress
>>> _BaseAddress()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/narel/.pyenv/versions/3.10.9/lib/python3.10/ipaddress.py", line 607, in __repr__
    return '%s(%r)' % (self.__class__.__name__, str(self))
  File "/home/narel/.pyenv/versions/3.10.9/lib/python3.10/ipaddress.py", line 610, in __str__
    return str(self._string_from_ip_int(self._ip))
AttributeError: '_BaseAddress' object has no attribute '_string_from_ip_int'. Did you mean: '_prefix_from_ip_int'?

Your environment

  • CPython versions tested on: 3.10.9
  • Operating system and architecture: Ubuntu 22.04 x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedtype-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions