Movatterモバイル変換


[0]ホーム

URL:


homepage

Message190715

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Authorfbm
Recipientsfbm
Date2013-06-06.14:07:35
SpamBayes Score-1.0
Marked as misclassifiedYes
Message-id<1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za>
In-reply-to
Content
Example:  with open('file1', 'w') as f:    f.write('a')  with open('file2', 'w') as f:    f.write('a')      print filecmp.cmp('file1', 'file2', shallow=False) # true  with open('file2', 'w') as f:    f.write('b')  print filecmp.cmp('file1', 'file2', shallow=False) # trueBecause of the caching, both calls to filecmp.cmp() return true on my system.When retrieving value from cache, the function filecmp.cmp() checks the signatures of the files:  s1 = _sig(os.stat(f1))  s2 = _sig(os.stat(f2))  ...  outcome = _cache.get((f1, f2, s1, s2))But the signatures in cache are the same, if the file sizes and times of modification (os.stat().st_mtime) haven't changed from the last call, even if the content has changed.The buffer is mentioned in the documentation, but there isn't any documented way to clear it. It also isn't nice IMO, that one has to worry about the file system's resolution of the file modification time when calling a simple file comparison.
History
DateUserActionArgs
2013-06-06 14:07:35fbmsetrecipients: +fbm
2013-06-06 14:07:35fbmsetmessageid: <1370527655.93.0.14200399247.issue18149@psf.upfronthosting.co.za>
2013-06-06 14:07:35fbmlinkissue18149 messages
2013-06-06 14:07:35fbmcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp