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 terry.reedy
Recipients Ravi.Sinha, chris.jerdonek, docs@python, r.david.murray, terry.reedy
Date 2012-10-07.18:33:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349634823.63.0.424472829647.issue16154@psf.upfronthosting.co.za>
In-reply-to
Content
I consider some items to be errors. In any case, all current docs can be fixed. First, your questions as to what you did not fix.

fsum: I personally would add the import visibly, but at least add it hidden, as Chris suggested.

171 >>> from filecmp import dircmp
172 >>> def print_diff_files(dcmp):
173 ... for name in dcmp.diff_files:
174 ... print("diff_file %s found in %s and %s" % (name, dcmp.left,
175 ... dcmp.right))
176 ... for sub_dcmp in dcmp.subdirs.values():
177 ... print_diff_files(sub_dcmp)
178 ...
179 >>> dcmp = dircmp('dir1', 'dir2')
180 >>> print_diff_files(dcmp)

(copying from the repository view deletes whitespace)
The import and def should run and should be tested.
The last 2 lines should not be tested: add #doctest: SKIP to both.
(I gather that Sphinx will strip this.)

   >>> width = 5
   >>> for num in range(5,12):
   ...     for base in 'dXob':
   ...         print('{0:{width}{base}}'.format(num, base=base, width=width), end=' ')
   ...     print()
   ...
       5     5     5   101
       6     6     6   110
       7     7     7   111
       8     8    10  1000
       9     9    11  1001
      10     A    12  1010
      11     B    13  1011

I believe the problem here is the "end = ''" part. It puts a blank space at the end of each line, which got deleted when I pasted the above, which was cut from my local repository. Trailing blanks are *really* a problem and code that produces them is not a good example. I suggest changing width to 6, end to '', and adding '' to the beginning of each output line. It should then pass.
History
Date User Action Args
2012-10-07 18:33:43terry.reedysetrecipients: + terry.reedy, r.david.murray, chris.jerdonek, docs@python, Ravi.Sinha
2012-10-07 18:33:43terry.reedysetmessageid: <1349634823.63.0.424472829647.issue16154@psf.upfronthosting.co.za>
2012-10-07 18:33:43terry.reedylinkissue16154 messages
2012-10-07 18:33:43terry.reedycreate