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.

classification
Title: os.utime doesn't allow a atime (Last Access) which is 27 years in the future.
Type: Stage:
Components: IO Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: amaury.forgeotdarc Nosy List: amaury.forgeotdarc, eric.smith, loewis, ramson, sandro.tosi
Priority: normal Keywords: patch

Created on 2010-04-01 07:46 by ramson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
utime_test.py ramson, 2010-04-01 07:46 code to reproduce this behaviour
timet_64.patch amaury.forgeotdarc, 2010-04-01 17:21 review
timet_64-2.patch amaury.forgeotdarc, 2011-01-02 22:48
Messages (9)
msg102069 - (view) Author: ramson (ramson) Date: 2010-04-01 07:46
Error Message is:
OverflowError: long int too large to convert to int
---
Python Version:
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32
---
Sample Code attached.
msg102109 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-04-01 17:21
On Windows, time_t is 64bit, but various functions convert it to a 32bit long.
Attached patch uses time_t instead of long in various places, this fixes the proposed test.

Martin, do you think it's a viable approach? If so, I'll go and add some tests for the modified functions.
msg102139 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-04-01 23:34
The patch looks fine to me, please apply.
msg125010 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-01-01 22:19
Hi Amaury, Martin ack'ed the patch: is there something else you want to do?
msg125115 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-01-02 22:48
Here is a renewed patch against py3k, with a test.
msg125127 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-01-02 23:35
The patch looks still fine. The only concern is that the test probably fails on FAT, but I think that's acceptable.
msg125129 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-01-02 23:37
> The only concern is that the test probably fails on FAT
The patch does not show it, but I've put the test under a
'if get_file_system(support.TESTFN) == "NTFS"'
msg125143 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-01-03 00:23
Committed r87666 (py3k), I'll backport to 3.1 and 2.7.
msg125146 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-01-03 00:52
Merged into release31-maint (r87668) and release27-maint (r87669)
History
Date User Action Args
2022-04-11 14:56:59adminsetgithub: 52525
2011-01-03 00:52:06amaury.forgeotdarcsetstatus: pending -> closed
nosy: loewis, amaury.forgeotdarc, eric.smith, sandro.tosi, ramson
messages: + msg125146
2011-01-03 00:23:47amaury.forgeotdarcsetstatus: open -> pending

messages: + msg125143
resolution: accepted -> fixed
nosy: loewis, amaury.forgeotdarc, eric.smith, sandro.tosi, ramson
2011-01-02 23:37:46amaury.forgeotdarcsetnosy: loewis, amaury.forgeotdarc, eric.smith, sandro.tosi, ramson
messages: + msg125129
2011-01-02 23:35:20loewissetnosy: loewis, amaury.forgeotdarc, eric.smith, sandro.tosi, ramson
messages: + msg125127
2011-01-02 22:48:28amaury.forgeotdarcsetfiles: + timet_64-2.patch
nosy: loewis, amaury.forgeotdarc, eric.smith, sandro.tosi, ramson
messages: + msg125115
2011-01-01 22:19:34sandro.tosisetnosy: + sandro.tosi
messages: + msg125010
2010-04-02 10:55:39amaury.forgeotdarcsetassignee: amaury.forgeotdarc
2010-04-01 23:34:18loewissetresolution: accepted
messages: + msg102139
2010-04-01 17:21:07amaury.forgeotdarcsetfiles: + timet_64.patch

nosy: + loewis, amaury.forgeotdarc
messages: + msg102109

keywords: + patch
2010-04-01 10:29:27eric.smithsetnosy: + eric.smith
2010-04-01 07:46:04ramsoncreate