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
f1380557
Kaydet (Commit)
f1380557
authored
Eki 29, 2012
tarafından
Petri Lehtinen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
#14897: Enhance error messages of struct.pack and struct.pack_into
Patch by Matti Mäki.
üst
2bb842a2
4648b477
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
_struct.c
Modules/_struct.c
+14
-4
No files found.
Misc/ACKS
Dosyayı görüntüle @
f1380557
...
@@ -820,6 +820,7 @@ Michael Muller
...
@@ -820,6 +820,7 @@ Michael Muller
Neil Muller
Neil Muller
Louis Munro
Louis Munro
R. David Murray
R. David Murray
Matti Mäki
Dale Nagata
Dale Nagata
John Nagle
John Nagle
Takahiro Nakayama
Takahiro Nakayama
...
...
Misc/NEWS
Dosyayı görüntüle @
f1380557
...
@@ -62,6 +62,9 @@ Core and Builtins
...
@@ -62,6 +62,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
14897
:
Enhance
error
messages
of
struct
.
pack
and
struct
.
pack_into
.
Patch
by
Matti
M
ä
ki
.
-
Issue
#
16316
:
mimetypes
now
recognizes
the
.
xz
and
.
txz
(.
tar
.
xz
)
extensions
.
-
Issue
#
16316
:
mimetypes
now
recognizes
the
.
xz
and
.
txz
(.
tar
.
xz
)
extensions
.
Patch
by
Serhiy
Storchaka
.
Patch
by
Serhiy
Storchaka
.
...
...
Modules/_struct.c
Dosyayı görüntüle @
f1380557
...
@@ -1661,7 +1661,7 @@ s_pack(PyObject *self, PyObject *args)
...
@@ -1661,7 +1661,7 @@ s_pack(PyObject *self, PyObject *args)
if
(
PyTuple_GET_SIZE
(
args
)
!=
soself
->
s_len
)
if
(
PyTuple_GET_SIZE
(
args
)
!=
soself
->
s_len
)
{
{
PyErr_Format
(
StructError
,
PyErr_Format
(
StructError
,
"pack
requires exactly %zd arguments"
,
soself
->
s_len
);
"pack
expected %zd items for packing (got %zd)"
,
soself
->
s_len
,
PyTuple_GET_SIZE
(
args
)
);
return
NULL
;
return
NULL
;
}
}
...
@@ -1700,9 +1700,19 @@ s_pack_into(PyObject *self, PyObject *args)
...
@@ -1700,9 +1700,19 @@ s_pack_into(PyObject *self, PyObject *args)
assert
(
soself
->
s_codes
!=
NULL
);
assert
(
soself
->
s_codes
!=
NULL
);
if
(
PyTuple_GET_SIZE
(
args
)
!=
(
soself
->
s_len
+
2
))
if
(
PyTuple_GET_SIZE
(
args
)
!=
(
soself
->
s_len
+
2
))
{
{
PyErr_Format
(
StructError
,
if
(
PyTuple_GET_SIZE
(
args
)
==
0
)
{
"pack_into requires exactly %zd arguments"
,
PyErr_Format
(
StructError
,
(
soself
->
s_len
+
2
));
"pack_into expected buffer argument"
);
}
else
if
(
PyTuple_GET_SIZE
(
args
)
==
1
)
{
PyErr_Format
(
StructError
,
"pack_into expected offset argument"
);
}
else
{
PyErr_Format
(
StructError
,
"pack_into expected %zd items for packing (got %zd)"
,
soself
->
s_len
,
(
PyTuple_GET_SIZE
(
args
)
-
2
));
}
return
NULL
;
return
NULL
;
}
}
...
...
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