Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a4d41b3a
Kaydet (Commit)
a4d41b3a
authored
Nis 13, 2016
tarafından
Steve Dower
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Closes #26624: Adds validation of ucrtbase[d].dll version with warning for old versions.
üst
0cab9c1e
a7a222fd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
99 additions
and
2 deletions
+99
-2
NEWS
Misc/NEWS
+3
-0
python_ver_rc.h
PC/python_ver_rc.h
+1
-2
validate_ucrtbase.py
PC/validate_ucrtbase.py
+88
-0
python.vcxproj
PCbuild/python.vcxproj
+7
-0
No files found.
Misc/NEWS
Dosyayı görüntüle @
a4d41b3a
...
...
@@ -973,6 +973,9 @@ Tests
Build
-----
- Issue #26624: Adds validation of ucrtbase[d].dll version with warning
for old versions.
- Issue #17603: Avoid error about nonexistant fileblocks.o file by using a
lower-level check for st_blocks in struct stat.
...
...
PC/python_ver_rc.h
Dosyayı görüntüle @
a4d41b3a
...
...
@@ -9,11 +9,10 @@
#define MS_WINDOWS
#include "modsupport.h"
#include "patchlevel.h"
#include <pythonnt_rc.h>
#ifdef _DEBUG
# include <pythonnt_rc_d.h>
# define PYTHON_DEBUG_EXT "_d"
#else
# include <pythonnt_rc.h>
# define PYTHON_DEBUG_EXT
#endif
...
...
PC/validate_ucrtbase.py
0 → 100644
Dosyayı görüntüle @
a4d41b3a
'''
This script gets the version number from ucrtbased.dll and checks
whether it is a version with a known issue.
'''
import
sys
from
ctypes
import
(
c_buffer
,
POINTER
,
byref
,
create_unicode_buffer
,
Structure
,
WinDLL
)
from
ctypes.wintypes
import
DWORD
,
HANDLE
class
VS_FIXEDFILEINFO
(
Structure
):
_fields_
=
[
(
"dwSignature"
,
DWORD
),
(
"dwStrucVersion"
,
DWORD
),
(
"dwFileVersionMS"
,
DWORD
),
(
"dwFileVersionLS"
,
DWORD
),
(
"dwProductVersionMS"
,
DWORD
),
(
"dwProductVersionLS"
,
DWORD
),
(
"dwFileFlagsMask"
,
DWORD
),
(
"dwFileFlags"
,
DWORD
),
(
"dwFileOS"
,
DWORD
),
(
"dwFileType"
,
DWORD
),
(
"dwFileSubtype"
,
DWORD
),
(
"dwFileDateMS"
,
DWORD
),
(
"dwFileDateLS"
,
DWORD
),
]
kernel32
=
WinDLL
(
'kernel32'
)
version
=
WinDLL
(
'version'
)
if
len
(
sys
.
argv
)
<
2
:
print
(
'Usage: validate_ucrtbase.py <ucrtbase|ucrtbased>'
)
sys
.
exit
(
2
)
try
:
ucrtbased
=
WinDLL
(
sys
.
argv
[
1
])
except
OSError
:
print
(
'Cannot find ucrtbased.dll'
)
# This likely means that VS is not installed, but that is an
# obvious enough problem if you're trying to produce a debug
# build that we don't need to fail here.
sys
.
exit
(
0
)
# We will immediately double the length up to MAX_PATH, but the
# path may be longer, so we retry until the returned string is
# shorter than our buffer.
name_len
=
actual_len
=
130
while
actual_len
==
name_len
:
name_len
*=
2
name
=
create_unicode_buffer
(
name_len
)
actual_len
=
kernel32
.
GetModuleFileNameW
(
HANDLE
(
ucrtbased
.
_handle
),
name
,
len
(
name
))
if
not
actual_len
:
print
(
'Failed to get full module name.'
)
sys
.
exit
(
2
)
size
=
version
.
GetFileVersionInfoSizeW
(
name
,
None
)
if
not
size
:
print
(
'Failed to get size of version info.'
)
sys
.
exit
(
2
)
ver_block
=
c_buffer
(
size
)
if
(
not
version
.
GetFileVersionInfoW
(
name
,
None
,
size
,
ver_block
)
or
not
ver_block
):
print
(
'Failed to get version info.'
)
sys
.
exit
(
2
)
pvi
=
POINTER
(
VS_FIXEDFILEINFO
)()
if
not
version
.
VerQueryValueW
(
ver_block
,
""
,
byref
(
pvi
),
byref
(
DWORD
())):
print
(
'Failed to get version value from info.'
)
sys
.
exit
(
2
)
ver
=
(
pvi
.
contents
.
dwProductVersionMS
>>
16
,
pvi
.
contents
.
dwProductVersionMS
&
0xFFFF
,
pvi
.
contents
.
dwProductVersionLS
>>
16
,
pvi
.
contents
.
dwProductVersionLS
&
0xFFFF
,
)
print
(
'{} is version {}.{}.{}.{}'
.
format
(
name
.
value
,
*
ver
))
if
ver
<
(
10
,
0
,
10586
):
print
(
'WARN: ucrtbased contains known issues. '
'Please update Visual Studio or the Windows SDK.'
)
print
(
'See:'
)
print
(
' http://bugs.python.org/issue26624'
)
sys
.
exit
(
1
)
PCbuild/python.vcxproj
Dosyayı görüntüle @
a4d41b3a
...
...
@@ -83,6 +83,13 @@
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.targets"
/>
<ImportGroup
Label=
"ExtensionTargets"
>
</ImportGroup>
<Target
Name=
"ValidateUcrtbase"
AfterTargets=
"AfterBuild"
>
<PropertyGroup>
<UcrtName>
ucrtbase
</UcrtName>
<UcrtName
Condition=
"'$(Configuration)' == 'Debug'"
>
ucrtbased
</UcrtName>
</PropertyGroup>
<Exec
Command=
'"$(OutDir)python$(PyDebugExt).exe" "$(PySourcePath)PC\validate_ucrtbase.py" $(UcrtName)'
ContinueOnError=
"true"
/>
</Target>
<Target
Name=
"GeneratePythonBat"
AfterTargets=
"AfterBuild"
>
<PropertyGroup>
<_Content>
@rem This script invokes the most recently built Python with all arguments
...
...
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