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
d8b129f2
Kaydet (Commit)
d8b129f2
authored
Tem 03, 2014
tarafından
Zachary Ware
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Closes #21151: Merge with 3.4
üst
a6237d82
ad4690fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
test_winreg.py
Lib/test/test_winreg.py
+14
-1
NEWS
Misc/NEWS
+3
-0
winreg.c
PC/winreg.c
+3
-1
No files found.
Lib/test/test_winreg.py
Dosyayı görüntüle @
d8b129f2
...
...
@@ -341,7 +341,7 @@ class LocalWinregTests(BaseWinregTests):
def
test_queryvalueex_return_value
(
self
):
# Test for Issue #16759, return unsigned int from QueryValueEx.
# Reg2Py, which gets called by QueryValueEx, was returning a value
# generated by PyLong_FromLong. The implmentation now uses
# generated by PyLong_FromLong. The impl
e
mentation now uses
# PyLong_FromUnsignedLong to match DWORD's size.
try
:
with
CreateKey
(
HKEY_CURRENT_USER
,
test_key_name
)
as
ck
:
...
...
@@ -354,6 +354,19 @@ class LocalWinregTests(BaseWinregTests):
finally
:
DeleteKey
(
HKEY_CURRENT_USER
,
test_key_name
)
def
test_setvalueex_crash_with_none_arg
(
self
):
# Test for Issue #21151, segfault when None is passed to SetValueEx
try
:
with
CreateKey
(
HKEY_CURRENT_USER
,
test_key_name
)
as
ck
:
self
.
assertNotEqual
(
ck
.
handle
,
0
)
test_val
=
None
SetValueEx
(
ck
,
"test_name"
,
0
,
REG_BINARY
,
test_val
)
ret_val
,
ret_type
=
QueryValueEx
(
ck
,
"test_name"
)
self
.
assertEqual
(
ret_type
,
REG_BINARY
)
self
.
assertEqual
(
ret_val
,
test_val
)
finally
:
DeleteKey
(
HKEY_CURRENT_USER
,
test_key_name
)
@unittest.skipUnless
(
REMOTE_NAME
,
"Skipping remote registry tests"
)
...
...
Misc/NEWS
Dosyayı görüntüle @
d8b129f2
...
...
@@ -103,6 +103,9 @@ Core and Builtins
Library
-------
- Issue #21151: Fixed a segfault in the winreg module when ``None`` is passed
as a ``REG_BINARY`` value to SetValueEx. Patch by John Ehresman.
- Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,
it ignored I/O errors if at least the first C call read() succeed.
...
...
PC/winreg.c
Dosyayı görüntüle @
d8b129f2
...
...
@@ -871,8 +871,10 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize)
/* ALSO handle ALL unknown data types here. Even if we can't
support it natively, we should handle the bits. */
default:
if
(
value
==
Py_None
)
if
(
value
==
Py_None
)
{
*
retDataSize
=
0
;
*
retDataBuf
=
NULL
;
}
else
{
Py_buffer
view
;
...
...
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