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
d21b58c0
Kaydet (Commit)
d21b58c0
authored
Şub 25, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #17223: Fix PyUnicode_FromUnicode() for string of 1 character outside
the range U+0000-U+10ffff.
üst
f8cf59e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
NEWS
Misc/NEWS
+3
-0
unicodeobject.c
Objects/unicodeobject.c
+7
-7
No files found.
Misc/NEWS
Dosyayı görüntüle @
d21b58c0
...
@@ -12,6 +12,9 @@ What's New in Python 3.3.1?
...
@@ -12,6 +12,9 @@ What's New in Python 3.3.1?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #17223: Fix PyUnicode_FromUnicode() for string of 1 character outside
the range U+0000-U+10ffff.
- Issue #17275: Corrected class name in init error messages of the C version of
- Issue #17275: Corrected class name in init error messages of the C version of
BufferedWriter and BufferedRandom.
BufferedWriter and BufferedRandom.
...
...
Objects/unicodeobject.c
Dosyayı görüntüle @
d21b58c0
...
@@ -249,7 +249,7 @@ static int unicode_modifiable(PyObject *unicode);
...
@@ -249,7 +249,7 @@ static int unicode_modifiable(PyObject *unicode);
static PyObject *
static PyObject *
_PyUnicode_FromUCS1(const
unsigned char
*s, Py_ssize_t size);
_PyUnicode_FromUCS1(const
Py_UCS1
*s, Py_ssize_t size);
static PyObject *
static PyObject *
_PyUnicode_FromUCS2(const Py_UCS2 *s, Py_ssize_t size);
_PyUnicode_FromUCS2(const Py_UCS2 *s, Py_ssize_t size);
static PyObject *
static PyObject *
...
@@ -442,7 +442,7 @@ unicode_result_wchar(PyObject *unicode)
...
@@ -442,7 +442,7 @@ unicode_result_wchar(PyObject *unicode)
if (len == 1) {
if (len == 1) {
wchar_t ch = _PyUnicode_WSTR(unicode)[0];
wchar_t ch = _PyUnicode_WSTR(unicode)[0];
if (ch < 256) {
if (
(Py_UCS4)
ch < 256) {
PyObject *latin1_char = get_latin1_char((unsigned char)ch);
PyObject *latin1_char = get_latin1_char((unsigned char)ch);
Py_DECREF(unicode);
Py_DECREF(unicode);
return latin1_char;
return latin1_char;
...
@@ -1761,7 +1761,7 @@ PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size)
...
@@ -1761,7 +1761,7 @@ PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size)
/* Single character Unicode objects in the Latin-1 range are
/* Single character Unicode objects in the Latin-1 range are
shared when using this constructor */
shared when using this constructor */
if (size == 1 && *u < 256)
if (size == 1 &&
(Py_UCS4)
*u < 256)
return get_latin1_char((unsigned char)*u);
return get_latin1_char((unsigned char)*u);
/* If not empty and not single character, copy the Unicode data
/* If not empty and not single character, copy the Unicode data
...
@@ -1869,7 +1869,7 @@ _PyUnicode_FromASCII(const char *buffer, Py_ssize_t size)
...
@@ -1869,7 +1869,7 @@ _PyUnicode_FromASCII(const char *buffer, Py_ssize_t size)
PyObject *unicode;
PyObject *unicode;
if (size == 1) {
if (size == 1) {
#ifdef Py_DEBUG
#ifdef Py_DEBUG
assert(s[0] < 128);
assert(
(unsigned char)
s[0] < 128);
#endif
#endif
return get_latin1_char(s[0]);
return get_latin1_char(s[0]);
}
}
...
@@ -1911,7 +1911,7 @@ align_maxchar(Py_UCS4 maxchar)
...
@@ -1911,7 +1911,7 @@ align_maxchar(Py_UCS4 maxchar)
}
}
static PyObject*
static PyObject*
_PyUnicode_FromUCS1(const
unsigned char
* u, Py_ssize_t size)
_PyUnicode_FromUCS1(const
Py_UCS1
* u, Py_ssize_t size)
{
{
PyObject *res;
PyObject *res;
unsigned char max_char;
unsigned char max_char;
...
@@ -2974,8 +2974,8 @@ PyUnicode_FromOrdinal(int ordinal)
...
@@ -2974,8 +2974,8 @@ PyUnicode_FromOrdinal(int ordinal)
return NULL;
return NULL;
}
}
if (ordinal < 256)
if (
(Py_UCS4)
ordinal < 256)
return get_latin1_char(ordinal);
return get_latin1_char(
(unsigned char)
ordinal);
v = PyUnicode_New(1, ordinal);
v = PyUnicode_New(1, ordinal);
if (v == NULL)
if (v == 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