[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution

2013-06-07 Thread Ned Deily

Ned Deily added the comment:

It seems like this would be a fairly rare situation and, as you note, dependent 
on the underlying file system.  But it would be easy to add a new function to 
the module to clear its cache in cases where it is known this might be a 
problem.  In fact, in Issue11802 a clear_cache function was proposed to solve 
the problem of the cache growing without bounds but that problem was solved by 
the simpler solution of discarding the cache when it gets above 100 entries.

--
keywords: +easy
nosy: +nadeem.vawda, ned.deily, rhettinger
stage:  -> needs patch
title: filecmp.cmp() - cache invalidation fails when file modification times 
haven't changed -> filecmp.cmp() incorrect results when previously compared 
file is modified within modification time resolution
versions: +Python 3.4 -Python 2.7

___
Python tracker 

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



[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution

2013-06-07 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1 for a cache clearing function like the one in re.py

--

___
Python tracker 

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



[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution

2013-06-12 Thread Mark Levitt

Mark Levitt added the comment:

I've added a "clear_cache()" method to filecmp.py. Patch attached. 

I had thought about implementing an optional parameter to only invalidate the 
cache of a specific file object, but figured I'd keep it simple for now.

First time submitting a patch, so apologies if I've done something the wrong 
way.

--
keywords: +patch
nosy: +melevittfl
Added file: http://bugs.python.org/file30557/18149.patch

___
Python tracker 

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



[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution

2013-06-12 Thread Ned Deily

Ned Deily added the comment:

Thanks for the patch, Mark. I've left some review comments via Rietveld (the 
review link next to the patch).  Also, if you haven't already, please fill out 
the contributor form as described in the Developer's Guide 
(http://docs.python.org/devguide/patch.html#licensing).

--

___
Python tracker 

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



[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution

2013-06-12 Thread Mark Levitt

Mark Levitt added the comment:

Ned,

Thanks for taking the time to review. I've updated the docs, added a unit test, 
signed the contributor form, and made the changes/corrections from your review.

Updated patch attached.

--
Added file: http://bugs.python.org/file30565/18149-2.patch

___
Python tracker 

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



[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution

2013-06-12 Thread Ned Deily

Ned Deily added the comment:

Looks good to me, other than that the doc change should include a version added 
directive (which can be added by the committer):

 .. function:: clear_cache()

+   .. versionadded:: 3.4
+
Clear the filecmp cache. This may be useful if a file is compared so quickly

--
stage: needs patch -> commit review

___
Python tracker 

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



[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution

2013-06-13 Thread Mark Levitt

Mark Levitt added the comment:

Cool. I've gone ahead and generated a new patch with the version added 
directive included.

--
Added file: http://bugs.python.org/file30571/18149-3.patch

___
Python tracker 

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



[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution

2013-06-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bfd53dcb02ff by Ned Deily in branch 'default':
Issue #18149: Add filecmp.clear_cache() to manually clear the filecmp cache.
http://hg.python.org/cpython/rev/bfd53dcb02ff

--
nosy: +python-dev

___
Python tracker 

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



[issue18149] filecmp.cmp() incorrect results when previously compared file is modified within modification time resolution

2013-06-14 Thread Ned Deily

Ned Deily added the comment:

Committed for release in 3.4.0.  Thanks, Mark.

--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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