Senthil Kumaran orsent...@gmail.com added the comment:
On Fri, Sep 03, 2010 at 10:57:17PM +, Georg Brandl wrote:
That's why I said to use testsetup directives -- they are not
visible in the HTML/PDF/... output, but used when running the tests.
Do you already have such a directive in
R. David Murray rdmur...@bitdance.com added the comment:
Yes, Georg mentioned the directive because it exists :)
See the turtle docs for some examples, I think. I seem to remember using it
when I made those doctests pass on 2.7 (warning: it writes weird stuff on your
screen :)
--
Georg Brandl ge...@python.org added the comment:
Fixed in r85642.
--
dependencies: -b64decode should accept strings or bytes
resolution: accepted - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:
That fixes the example code, but what about the numerous text that reads
strings that should read byte sequences, bytes, or similar?
--
___
Python tracker rep...@bugs.python.org
R. David Murray rdmur...@bitdance.com added the comment:
I reviewed the doc and tightened up the wording (which was already mostly
correct) in r85672. Also fixed one typo and changed it to consistently use
'byte string' (rather than 'bytestring' which was used in one or two places).
Terry J. Reedy tjre...@udel.edu added the comment:
I hope the trivial 2-byte fix does not get lost in the general issue.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9730
___
Terry J. Reedy tjre...@udel.edu added the comment:
PATCH
Specifically, in section 17.6. base64..., near bottom, example should be
import base64
encoded = base64.b64encode(b'data to be encoded') #hang
encoded
b'ZGF0YSB0byBiZSBlbmNvZGVk'
data = base64.b64decode(encoded)
data
b'data to be
Terry J. Reedy tjre...@udel.edu added the comment:
As an experiment, I ran doctest on 17.2 json saved as .txt, See #9767
4 failures, 2 obvious doc faults, 2 unclear to me.
Their were 2 similar doc faults in non-interactive code examples, so doctest is
not enough to catch all bad code.
We
Éric Araujo mer...@netwok.org added the comment:
It seems there are three ways of testing the docs:
1) ./python -m doctest Doc/library/json.rst
2) make doctest (a.k.a. sphinx-build -b doctest)
3) http://sphinx.pocoo.org/ext/doctest.html
Manually running 1) or 2) and fixing things seems okay
Éric Araujo mer...@netwok.org added the comment:
Note also that some docs (turtle) require running Tcl, which may be unwanted on
headless machines like buildbots.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9730
Georg Brandl ge...@python.org added the comment:
Generally: +1 on making sure examples in the docs are up to date. If someone
wants to do the tedious work of making sure that a make doctest succeeds, I'm
all for it, it may involve adding a few (in HTML output invisible) testsetup
blocks.
Antoine Pitrou pit...@free.fr added the comment:
Generally: +1 on making sure examples in the docs are up to date. If
someone wants to do the tedious work of making sure that a make
doctest succeeds, I'm all for it, it may involve adding a few (in
HTML output invisible) testsetup blocks.
Éric Araujo mer...@netwok.org added the comment:
2) works without changing anything, 3) requires using specific directives IIUC.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9730
___
Georg Brandl ge...@python.org added the comment:
Generally: +1 on making sure examples in the docs are up to date. If
someone wants to do the tedious work of making sure that a make
doctest succeeds, I'm all for it, it may involve adding a few (in
HTML output invisible) testsetup blocks.
Georg Brandl ge...@python.org added the comment:
2) works without changing anything, 3) requires using specific directives
IIUC.
No. The doctest extension is what make doctest calls.
--
___
Python tracker rep...@bugs.python.org
Éric Araujo mer...@netwok.org added the comment:
Thanks for clearing this misunderstanding of mine.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9730
___
R. David Murray rdmur...@bitdance.com added the comment:
See issue 4769, which would partially fix this problem if implemented
correctly. The docs should still be given a thorough review to use the
appropriate bytes/string language.
There is a way to do automated testing of the code in the
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:
The example can be fixed by placing a b before the two string literals.
However, pretty much the whole document refers to strings and should refer to
byte sequences or the bytes type.
I thought there were automated tests that
18 matches
Mail list logo