This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.jerdonek
Recipients chris.jerdonek, docs@python, ncoghlan, pmoody
Date 2012-09-09.11:32:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347190349.96.0.156720503481.issue15888@psf.upfronthosting.co.za>
In-reply-to
Content
The ipaddress HOWTO seems to have some errors in its interactive doctest examples.  Below are the errors after running the doctests for it using the regrtest patch posted to issue 15629.  (This is the first doc file for which I have used the modified script to open an issue.)

The errors seem valid to me on casual inspection.

Note that you need to add an initial ">>> import ipaddress" at the beginning of the first doctest example to have these actually run.


----------------------------------------------------------------------
File "Doc/howto/ipaddress.rst", line 146, in ipaddress.rst
Failed example:
    ipaddress.ip_network('2001:db8::1/96')
Exception raised:
    Traceback (most recent call last):
      File "Lib/doctest.py", line 1287, in __run
        compileflags, 1), test.globs)
      File "<doctest ipaddress.rst[15]>", line 1, in <module>
        ipaddress.ip_network('2001:db8::1/96')
      File "Lib/ipaddress.py", line 79, in ip_network
        return IPv6Network(address, strict)
      File "Lib/ipaddress.py", line 2056, in __init__
        raise ValueError('%s has host bits set' % self)
    ValueError: 2001:db8::1/96 has host bits set
----------------------------------------------------------------------
File "Doc/howto/ipaddress.rst", line 181, in ipaddress.rst
Failed example:
    net4.numhosts
Exception raised:
    Traceback (most recent call last):
      File "Lib/doctest.py", line 1287, in __run
        compileflags, 1), test.globs)
      File "<doctest ipaddress.rst[25]>", line 1, in <module>
        net4.numhosts
    AttributeError: 'IPv4Network' object has no attribute 'numhosts'
----------------------------------------------------------------------
File "Doc/howto/ipaddress.rst", line 184, in ipaddress.rst
Failed example:
    net6.numhosts
Exception raised:
    Traceback (most recent call last):
      File "Lib/doctest.py", line 1287, in __run
        compileflags, 1), test.globs)
      File "<doctest ipaddress.rst[27]>", line 1, in <module>
        net6.numhosts
    AttributeError: 'IPv6Network' object has no attribute 'numhosts'
----------------------------------------------------------------------
File "Doc/howto/ipaddress.rst", line 190, in ipaddress.rst
Failed example:
    for x in net4.hosts():
Exception raised:
    Traceback (most recent call last):
      File "Lib/doctest.py", line 1287, in __run
        compileflags, 1), test.globs)
      File "<doctest ipaddress.rst[29]>", line 1
        for x in net4.hosts():
                             ^
    SyntaxError: unexpected EOF while parsing
----------------------------------------------------------------------
File "Doc/howto/ipaddress.rst", line 219, in ipaddress.rst
Failed example:
    addr6.exploded
Expected:
    '2001:0db8:0000:0000:0000:0000:0000:0000'
Got:
    '2001:0db8:0000:0000:0000:0000:0000:0001'
----------------------------------------------------------------------
File "Doc/howto/ipaddress.rst", line 221, in ipaddress.rst
Failed example:
    addr6.compressed
Expected:
    '2001:db8::'
Got:
    '2001:db8::1'
----------------------------------------------------------------------
File "Doc/howto/ipaddress.rst", line 244, in ipaddress.rst
Failed example:
    net6[1]
Expected:
    IPv6Address('2001::1')
Got:
    IPv6Address('2001:db8::1')
----------------------------------------------------------------------
File "Doc/howto/ipaddress.rst", line 246, in ipaddress.rst
Failed example:
    net6[-1]
Expected:
    IPv6Address('2001::ffff:ffff')
Got:
    IPv6Address('2001:db8::ffff:ffff')
History
Date User Action Args
2012-09-09 11:32:30chris.jerdoneksetrecipients: + chris.jerdonek, ncoghlan, pmoody, docs@python
2012-09-09 11:32:29chris.jerdoneksetmessageid: <1347190349.96.0.156720503481.issue15888@psf.upfronthosting.co.za>
2012-09-09 11:32:29chris.jerdoneklinkissue15888 messages
2012-09-09 11:32:28chris.jerdonekcreate