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.
Created on 2010年10月19日 23:14 by shaurz, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (7) | |||
|---|---|---|---|
| msg119176 - (view) | Author: Luke McCarthy (shaurz) | Date: 2010年10月19日 23:14 | |
When copying a file with shutil.copy2() between two ext4 filesystems on 64-bit Linux, the mtime of the destination file is different after the copy. It appears as if the resolution is slightly different, so the mtime is truncated slightly. For example: source file mtime: 1287367331.8433506 destination file mtime: 1287367331.84335 |
|||
| msg119181 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2010年10月20日 00:32 | |
This is a system limitation. The underlying file system supports nanosecond resolution for the file stamps, and stat(2) also supports reporting them. However, utimes(2) only supports microsecond resolution when setting them. Linux supports utimensat(2) since 2.6.22 (July 2007), however, Python doesn't use it. It would be possible to come up with a patch to transparently use it where available. Are you interested in writing such a patch? As a consequential issue: For Python, a long time ago, it was decided that time stamps in system interfaces are floating point numbers. As a consequence, nanoseconds cannot be accurately represented for today's dates (IIUC). I doubt there is anything we could do about this; this is likely "won't fix". |
|||
| msg127306 - (view) | Author: Peter (maubp) | Date: 2011年01月28日 14:50 | |
I'm also seeing this on 32bit Windows XP using Python 3.1.2, and Python 3.2rc1 on a local NTFS filesystem. e.g. from os.stat(filename).st_mtime after using shutil.copy2(...) 1293634856.1402586 source 1293634856.1402581 copied I've been using shutil.copy2 then expecting st_mtime will be equal (or at least that the copy file will be newer than the original). As you can see in this case, the copy is sometimes a fraction older. The same issue occurs using shutil.copy then shutils.copystat (probably not a surprise). |
|||
| msg134619 - (view) | Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) | Date: 2011年04月27日 21:03 | |
Python >=3.3 contains os.futimens() and os.utimensat() functions. I have filed issue #11941, which suggests to add support for nanosecond resolution in result of os.stat(). |
|||
| msg155604 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年03月13日 13:02 | |
This issue is a duplicate of #14127. |
|||
| msg160048 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年05月06日 00:40 | |
New changeset 709850f1ec67 by Larry Hastings in branch 'default': Update Misc/NEWS for issues #14127 and #14705. (And, technically, #10148.) http://hg.python.org/cpython/rev/709850f1ec67 |
|||
| msg160055 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年05月06日 04:58 | |
New changeset 05274ab06182 by Larry Hastings in branch 'default': Update Misc/NEWS for issues #14127 and #14705. (And, technically, #10148.) http://hg.python.org/cpython/rev/05274ab06182 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:07 | admin | set | github: 54357 |
| 2012年05月06日 04:58:44 | python-dev | set | messages: + msg160055 |
| 2012年05月06日 00:40:16 | python-dev | set | nosy:
+ python-dev messages: + msg160048 |
| 2012年03月13日 13:02:05 | vstinner | set | status: open -> closed nosy: + vstinner messages: + msg155604 resolution: duplicate |
| 2011年04月27日 21:03:58 | Arfrever | set | messages: + msg134619 |
| 2011年04月27日 08:36:49 | eric.araujo | set | nosy:
+ eric.araujo |
| 2011年01月28日 15:14:49 | Arfrever | set | nosy:
+ Arfrever |
| 2011年01月28日 14:50:21 | maubp | set | nosy:
+ maubp messages: + msg127306 |
| 2010年10月20日 00:32:33 | loewis | set | nosy:
+ loewis messages: + msg119181 |
| 2010年10月19日 23:14:29 | shaurz | create | |