[issue15888] ipaddress HOWTO examples have some errors

2012-09-09 Thread Chris Jerdonek

Chris Jerdonek added the comment:

While we are here, the corresponding Python file also has a couple errors in 
one of its doctest examples.

File "Lib/ipaddress.py", line 209, in ipaddress.summarize_address_range
Failed example:
summarize_address_range(IPv4Address('192.0.2.0'),
Exception raised:
Traceback (most recent call last):
  File "Lib/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
  File "", line 1
summarize_address_range(IPv4Address('192.0.2.0'),
^
SyntaxError: unexpected EOF while parsing

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15888] ipaddress HOWTO examples have some errors

2012-09-09 Thread Chris Jerdonek

New submission from Chris Jerdonek:

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 "", line 1, in 
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 "", line 1, in 
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 "", line 1, in 
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 "", 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::::::'
Got:
'2001:0db8::::::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:::')
Got:
IPv6Address('2001:db8:::')

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 170097
nosy: cjerdonek, docs@python, ncoghlan, pmoody
priority: normal
severity: normal
stage: needs patch
status: open
title: ipaddress HOWTO examples have some errors
type: behavior
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com