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
1dffb120
Kaydet (Commit)
1dffb120
authored
Tem 08, 2004
tarafından
Marc-André Lemburg
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
.encode()/.decode() patch part 2.
üst
d2d4598e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
stringobject.c
Objects/stringobject.c
+10
-0
unicodeobject.c
Objects/unicodeobject.c
+10
-0
No files found.
Objects/stringobject.c
Dosyayı görüntüle @
1dffb120
...
...
@@ -2678,6 +2678,8 @@ string_encode(PyStringObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"|ss:encode"
,
&
encoding
,
&
errors
))
return
NULL
;
v
=
PyString_AsEncodedObject
((
PyObject
*
)
self
,
encoding
,
errors
);
if
(
v
==
NULL
)
goto
onError
;
if
(
!
PyString_Check
(
v
)
&&
!
PyUnicode_Check
(
v
))
{
PyErr_Format
(
PyExc_TypeError
,
"encoder did not return a string/unicode object "
...
...
@@ -2687,6 +2689,9 @@ string_encode(PyStringObject *self, PyObject *args)
return
NULL
;
}
return
v
;
onError:
return
NULL
;
}
...
...
@@ -2710,6 +2715,8 @@ string_decode(PyStringObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"|ss:decode"
,
&
encoding
,
&
errors
))
return
NULL
;
v
=
PyString_AsDecodedObject
((
PyObject
*
)
self
,
encoding
,
errors
);
if
(
v
==
NULL
)
goto
onError
;
if
(
!
PyString_Check
(
v
)
&&
!
PyUnicode_Check
(
v
))
{
PyErr_Format
(
PyExc_TypeError
,
"decoder did not return a string/unicode object "
...
...
@@ -2719,6 +2726,9 @@ string_decode(PyStringObject *self, PyObject *args)
return
NULL
;
}
return
v
;
onError:
return
NULL
;
}
...
...
Objects/unicodeobject.c
Dosyayı görüntüle @
1dffb120
...
...
@@ -4935,6 +4935,8 @@ unicode_encode(PyUnicodeObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "|ss:encode", &encoding, &errors))
return NULL;
v = PyUnicode_AsEncodedObject((PyObject *)self, encoding, errors);
if (v == NULL)
goto onError;
if (!PyString_Check(v) && !PyUnicode_Check(v)) {
PyErr_Format(PyExc_TypeError,
"encoder did not return a string/unicode object "
...
...
@@ -4944,6 +4946,9 @@ unicode_encode(PyUnicodeObject *self, PyObject *args)
return NULL;
}
return v;
onError:
return NULL;
}
PyDoc_STRVAR(decode__doc__,
...
...
@@ -4966,6 +4971,8 @@ unicode_decode(PyStringObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "|ss:decode", &encoding, &errors))
return NULL;
v = PyUnicode_AsDecodedObject((PyObject *)self, encoding, errors);
if (v == NULL)
goto onError;
if (!PyString_Check(v) && !PyUnicode_Check(v)) {
PyErr_Format(PyExc_TypeError,
"decoder did not return a string/unicode object "
...
...
@@ -4975,6 +4982,9 @@ unicode_decode(PyStringObject *self, PyObject *args)
return NULL;
}
return v;
onError:
return NULL;
}
PyDoc_STRVAR(expandtabs__doc__,
...
...
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