Issue3425
Created on 2008-07-22 13:56 by oskar86, last changed 2009-05-28 10:07 by jszakmeister.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
issue-3425-utimes.patch
|
jszakmeister,
2009-05-28 10:07
|
Patch to use utimes() when the arg is None. |
|
|
|
msg70147 - (view) |
Author: Oskar Andersson (oskar86) |
Date: 2008-07-22 13:56 |
|
I'm porting, embedding and extending Python in a very limited environment.
This environment does not have utime.h and have not defined the
following function:
int utime(const char *, const struct utimbuf *);
Although the function called utimes, defined in sys/time.h exist.
int utimes(const char *path, const struct timeval times[2]);
In the method, in posixmodule.c:
static PyObject *
posix_utime(PyObject *self, PyObject *args);
usage of these methods are used. If a time is specified in args, a
define determines which of the two methods to use, utime or utimes
depending if these exist or not.
If Py_None is sent instead utime is always used, the solution to solve
this is to use #ifdef with HAVE_UTIMES.
Line number 2835 in
Modules/posixmodule.c">http://svn.python.org/projects/python/trunk/Modules/posixmodule.c
I have not checked if this is solved in future versions.
|
|
msg88471 - (view) |
Author: John Szakmeister (jszakmeister) |
Date: 2009-05-28 10:07 |
|
It seems reasonable to prefer utimes() over utime() in all cases, when
utimes() is available, since utime() is considered obsolete. I've
attached a patch with the required change and ran all the tests. There
are some tests failing on trunk with my system. However this patch
introduced no additional failures (test_posix passes). BTW, the patch is
against trunk.
|
|
| Date |
User |
Action |
Args |
| 2009-05-28 10:07:42 | jszakmeister | set | files:
+ issue-3425-utimes.patch
nosy:
+ jszakmeister messages:
+ msg88471
keywords:
+ patch |
| 2008-07-22 13:56:32 | oskar86 | create | |
|