Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
463a42b5
Commit
463a42b5
authored
Oct 09, 2006
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1565150: Fix subsecond processing for os.utime on Windows.
parent
6bf55013
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
Lib/test/test_os.py
Lib/test/test_os.py
+8
-0
Misc/NEWS
Misc/NEWS
+2
-0
Modules/posixmodule.c
Modules/posixmodule.c
+3
-3
No files found.
Lib/test/test_os.py
View file @
463a42b5
...
@@ -223,6 +223,14 @@ class StatAttributeTests(unittest.TestCase):
...
@@ -223,6 +223,14 @@ class StatAttributeTests(unittest.TestCase):
except
TypeError
:
except
TypeError
:
pass
pass
# Restrict test to Win32, since there is no guarantee other
# systems support centiseconds
if
sys
.
platform
==
'win32'
:
def
test_1565150
(
self
):
t1
=
1159195039.25
os
.
utime
(
self
.
fname
,
(
t1
,
t1
))
self
.
assertEquals
(
os
.
stat
(
self
.
fname
).
st_mtime
,
t1
)
from
test
import
mapping_tests
from
test
import
mapping_tests
class
EnvironTests
(
mapping_tests
.
BasicTestMappingProtocol
):
class
EnvironTests
(
mapping_tests
.
BasicTestMappingProtocol
):
...
...
Misc/NEWS
View file @
463a42b5
...
@@ -49,6 +49,8 @@ Core and builtins
...
@@ -49,6 +49,8 @@ Core and builtins
Extension
Modules
Extension
Modules
-----------------
-----------------
-
Bug
#
1565150
:
Fix
subsecond
processing
for
os
.
utime
on
Windows
.
-
Patch
#
1572724
:
fix
typo
(
'='
instead
of
'=='
)
in
_msi
.
c
.
-
Patch
#
1572724
:
fix
typo
(
'='
instead
of
'=='
)
in
_msi
.
c
.
-
Bug
#
1572832
:
fix
a
bug
in
ISO
-
2022
codecs
which
may
cause
segfault
-
Bug
#
1572832
:
fix
a
bug
in
ISO
-
2022
codecs
which
may
cause
segfault
...
...
Modules/posixmodule.c
View file @
463a42b5
...
@@ -792,7 +792,7 @@ time_t_to_FILE_TIME(int time_in, int nsec_in, FILETIME *out_ptr)
...
@@ -792,7 +792,7 @@ time_t_to_FILE_TIME(int time_in, int nsec_in, FILETIME *out_ptr)
/* XXX endianness */
/* XXX endianness */
__int64
out
;
__int64
out
;
out
=
time_in
+
secs_between_epochs
;
out
=
time_in
+
secs_between_epochs
;
out
=
out
*
10000000
+
nsec_in
;
out
=
out
*
10000000
+
nsec_in
/
100
;
memcpy
(
out_ptr
,
&
out
,
sizeof
(
out
));
memcpy
(
out_ptr
,
&
out
,
sizeof
(
out
));
}
}
...
@@ -2501,11 +2501,11 @@ posix_utime(PyObject *self, PyObject *args)
...
@@ -2501,11 +2501,11 @@ posix_utime(PyObject *self, PyObject *args)
if
(
extract_time
(
PyTuple_GET_ITEM
(
arg
,
0
),
if
(
extract_time
(
PyTuple_GET_ITEM
(
arg
,
0
),
&
atimesec
,
&
ausec
)
==
-
1
)
&
atimesec
,
&
ausec
)
==
-
1
)
goto
done
;
goto
done
;
time_t_to_FILE_TIME
(
atimesec
,
ausec
,
&
atime
);
time_t_to_FILE_TIME
(
atimesec
,
1000
*
ausec
,
&
atime
);
if
(
extract_time
(
PyTuple_GET_ITEM
(
arg
,
1
),
if
(
extract_time
(
PyTuple_GET_ITEM
(
arg
,
1
),
&
mtimesec
,
&
musec
)
==
-
1
)
&
mtimesec
,
&
musec
)
==
-
1
)
goto
done
;
goto
done
;
time_t_to_FILE_TIME
(
mtimesec
,
musec
,
&
mtime
);
time_t_to_FILE_TIME
(
mtimesec
,
1000
*
musec
,
&
mtime
);
}
}
if
(
!
SetFileTime
(
hFile
,
NULL
,
&
atime
,
&
mtime
))
{
if
(
!
SetFileTime
(
hFile
,
NULL
,
&
atime
,
&
mtime
))
{
/* Avoid putting the file name into the error here,
/* Avoid putting the file name into the error here,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment