[issue15454] Allow dircmp.report() output stream to be customized

2019-07-29 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is not newcomer friendly, I remove the easy keyword.

--
keywords:  -easy
nosy: +vstinner

___
Python tracker 

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-31 Thread Chris Calloway

Chris Calloway added the comment:

At the PyOhio sprints, I noticed this issue and found it interesting for low 
hanging fruit. First I went to make tests for this enhancement, only to find 
that report(), report_partial_closure(), and report_full_closure did not 
already have tests.

In adding tests for these methods, I also found that dircmp is only tested for 
one directory level, leaving out coverage for a pretty wide swath of dircmp.

The first patch I'm submitting here is just for the report methods for the 
level of dircmp testing which already exists. A subsequent patch will test the 
report methods a couple of directory levels deep to get full coverage for 
report_full_closure().

Even if this enhancement is not accepted, the report methods do need tests. I'm 
putting this patch here in advance of any other work to get feedback on the 
flavor of tests I have given the report methods on the existing one directory 
level of dircmp testing before proceeding with any deeper testing.

The tests in this patch all pass with the existing filecmp code without adding 
any significant execution time to test_filecmp.

Any deeper testing  of dircmp will also have to not be necessarily 
comprehensive, as the permutations of test inputs start to become too 
time-consuming. setUp and tearDown may also need some refactoring for deeper 
testing.

Should adding tests for the report methods be a separate issue from this 
enhancement?

--
keywords: +patch
Added file: http://bugs.python.org/file26625/issue-15454-1.patch

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-31 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 Should adding tests for the report methods be a separate issue from this 
 enhancement?

Yes, I would create separate issues for this.  I would even recommend 
separating this into one issue for the report() methods (could be done first), 
and another issue for adding tests for additional directory levels (see 
additional note below).

 Any deeper testing of dircmp will also have to not be necessarily 
 comprehensive, as the permutations of test inputs start to become too 
 time-consuming. setUp and tearDown may also need some refactoring for deeper 
 testing.

For testing additional directory levels, you may want to wait until after issue 
15403 is complete, which is slated for (hopefully) shortly after the 3.3 
release.  That issue will add functions for the easy creation of arbitrarily 
nested directories of files, etc.  You will see I made a comment there about 
application to the filecmp tests.

--

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-31 Thread Chris Calloway

Chris Calloway added the comment:

Thank you and the issue to add report method tests is issue 15518.

--

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-29 Thread Chris Calloway

Changes by Chris Calloway c...@chriscalloway.org:


--
nosy: +cbc

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-26 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

Currently, filecmp.dircmp's report(), report_partial_closure(), and 
report_full_closure() methods all only allow printing to stdout.

This issue is to provide some way for the caller to control the stream to which 
these methods print their output (e.g. a 'stream' argument on the three 
methods).

This suggestion was made by Eli in the discussion for issue 15269.

--
components: Library (Lib)
keywords: easy
messages: 166464
nosy: cjerdonek, eli.bendersky
priority: normal
severity: normal
status: open
title: Allow dircmp.report() output stream to be customized
type: enhancement
versions: Python 3.4

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-26 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc amaur...@gmail.com:


--
stage:  - needs patch

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



[issue15454] Allow dircmp.report() output stream to be customized

2012-07-26 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

For discussion purposes, I'd like to mention an alternate approach.  (I haven't 
yet formed an opinion on what approach is preferable.)

Python's built-in print() function accepts more than just a 'file' keyword 
argument:

http://docs.python.org/dev/library/functions.html#print

In addition, because adding a stream argument would require modifying the 
signatures of three different methods, adding a stream argument might not set 
us on the right path if we'd like to add support for more arguments to print() 
in the future (or add additional methods that print output alongside the 
existing reporting methods).

Another approach is to add a print() method to the dircmp class and have the 
report methods call self.print() instead of print().  With this approach, 
callers wanting a different output stream could subclass dircmp and override 
the print method.  This approach also seems like it would offer more 
flexibility.

--

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