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
369606df
Kaydet (Commit)
369606df
authored
Eyl 23, 2013
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19028: Fixed tkinter.Tkapp.merge() for non-string arguments.
üst
587b3057
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
12 deletions
+36
-12
test_tcl.py
Lib/test/test_tcl.py
+31
-0
NEWS
Misc/NEWS
+2
-0
_tkinter.c
Modules/_tkinter.c
+3
-12
No files found.
Lib/test/test_tcl.py
Dosyayı görüntüle @
369606df
...
@@ -254,6 +254,37 @@ class TclTest(unittest.TestCase):
...
@@ -254,6 +254,37 @@ class TclTest(unittest.TestCase):
for
arg
,
res
in
testcases
:
for
arg
,
res
in
testcases
:
self
.
assertEqual
(
split
(
arg
),
res
,
msg
=
arg
)
self
.
assertEqual
(
split
(
arg
),
res
,
msg
=
arg
)
def
test_merge
(
self
):
with
support
.
check_warnings
((
'merge is deprecated'
,
DeprecationWarning
)):
merge
=
self
.
interp
.
tk
.
merge
call
=
self
.
interp
.
tk
.
call
testcases
=
[
((),
''
),
((
'a'
,),
'a'
),
((
2
,),
'2'
),
((
''
,),
'{}'
),
(
'{'
,
'
\\
{'
),
((
'a'
,
'b'
,
'c'
),
'a b c'
),
((
' '
,
'
\t
'
,
'
\r
'
,
'
\n
'
),
'{ } {
\t
} {
\r
} {
\n
}'
),
((
'a'
,
' '
,
'c'
),
'a { } c'
),
((
'a'
,
'€'
),
'a €'
),
((
'a'
,
'
\U000104a2
'
),
'a
\U000104a2
'
),
((
'a'
,
b
'
\xe2\x82\xac
'
),
'a €'
),
((
'a'
,
(
'b'
,
'c'
)),
'a {b c}'
),
((
'a'
,
2
),
'a 2'
),
((
'a'
,
3.4
),
'a 3.4'
),
((
'a'
,
(
2
,
3.4
)),
'a {2 3.4}'
),
((),
''
),
((
call
(
'list'
,
1
,
'2'
,
(
3.4
,)),),
'{1 2 3.4}'
),
((
call
(
'dict'
,
'create'
,
12
,
'
\u20ac
'
,
b
'
\xe2\x82\xac
'
,
(
3.4
,)),),
'{12 € € 3.4}'
),
]
for
args
,
res
in
testcases
:
self
.
assertEqual
(
merge
(
*
args
),
res
,
msg
=
args
)
self
.
assertRaises
(
UnicodeDecodeError
,
merge
,
b
'
\x80
'
)
self
.
assertRaises
(
UnicodeEncodeError
,
merge
,
'
\udc80
'
)
class
BigmemTclTest
(
unittest
.
TestCase
):
class
BigmemTclTest
(
unittest
.
TestCase
):
...
...
Misc/NEWS
Dosyayı görüntüle @
369606df
...
@@ -68,6 +68,8 @@ Core and Builtins
...
@@ -68,6 +68,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #19028: Fixed tkinter.Tkapp.merge() for non-string arguments.
- Issue #3015: Fixed tkinter with wantobject=False. Any Tcl command call
- Issue #3015: Fixed tkinter with wantobject=False. Any Tcl command call
returned empty string.
returned empty string.
...
...
Modules/_tkinter.c
Dosyayı görüntüle @
369606df
...
@@ -331,17 +331,8 @@ AsString(PyObject *value, PyObject *tmp)
...
@@ -331,17 +331,8 @@ AsString(PyObject *value, PyObject *tmp)
{
{
if
(
PyBytes_Check
(
value
))
if
(
PyBytes_Check
(
value
))
return
PyBytes_AsString
(
value
);
return
PyBytes_AsString
(
value
);
else
if
(
PyUnicode_Check
(
value
))
{
else
if
(
PyUnicode_Check
(
value
))
PyObject
*
v
=
PyUnicode_AsUTF8String
(
value
);
return
PyUnicode_AsUTF8
(
value
);
if
(
v
==
NULL
)
return
NULL
;
if
(
PyList_Append
(
tmp
,
v
)
!=
0
)
{
Py_DECREF
(
v
);
return
NULL
;
}
Py_DECREF
(
v
);
return
PyBytes_AsString
(
v
);
}
else
{
else
{
PyObject
*
v
=
PyObject_Str
(
value
);
PyObject
*
v
=
PyObject_Str
(
value
);
if
(
v
==
NULL
)
if
(
v
==
NULL
)
...
@@ -351,7 +342,7 @@ AsString(PyObject *value, PyObject *tmp)
...
@@ -351,7 +342,7 @@ AsString(PyObject *value, PyObject *tmp)
return
NULL
;
return
NULL
;
}
}
Py_DECREF
(
v
);
Py_DECREF
(
v
);
return
Py
Bytes_AsString
(
v
);
return
Py
Unicode_AsUTF8
(
v
);
}
}
}
}
...
...
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