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
d6703b5e
Kaydet (Commit)
d6703b5e
authored
May 21, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #5640: Fix Shift-JIS incremental encoder for error handlers different
than strict
üst
fa0fdb89
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
test_multibytecodec.py
Lib/test/test_multibytecodec.py
+4
-0
NEWS
Misc/NEWS
+3
-0
multibytecodec.c
Modules/cjkcodecs/multibytecodec.c
+1
-1
No files found.
Lib/test/test_multibytecodec.py
Dosyayı görüntüle @
d6703b5e
...
@@ -107,6 +107,10 @@ class Test_IncrementalEncoder(unittest.TestCase):
...
@@ -107,6 +107,10 @@ class Test_IncrementalEncoder(unittest.TestCase):
self
.
assertRaises
(
UnicodeEncodeError
,
encoder
.
encode
,
u'
\u0123
'
)
self
.
assertRaises
(
UnicodeEncodeError
,
encoder
.
encode
,
u'
\u0123
'
)
self
.
assertEqual
(
encoder
.
encode
(
u''
,
True
),
'
\xa9\xdc
'
)
self
.
assertEqual
(
encoder
.
encode
(
u''
,
True
),
'
\xa9\xdc
'
)
def
test_issue5640
(
self
):
encoder
=
codecs
.
getincrementalencoder
(
'shift-jis'
)(
'backslashreplace'
)
self
.
assertEqual
(
encoder
.
encode
(
u'
\xff
'
),
b
'
\\
xff'
)
self
.
assertEqual
(
encoder
.
encode
(
u'
\n
'
),
b
'
\n
'
)
class
Test_IncrementalDecoder
(
unittest
.
TestCase
):
class
Test_IncrementalDecoder
(
unittest
.
TestCase
):
...
...
Misc/NEWS
Dosyayı görüntüle @
d6703b5e
...
@@ -29,6 +29,9 @@ C-API
...
@@ -29,6 +29,9 @@ C-API
Library
Library
-------
-------
- Issue #5640: Fix Shift-JIS incremental encoder for error handlers different
than strict
- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
- Issue #8782: Add a trailing newline in linecache.updatecache to the last line
of files without one.
of files without one.
...
...
Modules/cjkcodecs/multibytecodec.c
Dosyayı görüntüle @
d6703b5e
...
@@ -498,7 +498,6 @@ multibytecodec_encode(MultibyteCodec *codec,
...
@@ -498,7 +498,6 @@ multibytecodec_encode(MultibyteCodec *codec,
outleft
=
(
Py_ssize_t
)(
buf
.
outbuf_end
-
buf
.
outbuf
);
outleft
=
(
Py_ssize_t
)(
buf
.
outbuf_end
-
buf
.
outbuf
);
r
=
codec
->
encode
(
state
,
codec
->
config
,
&
buf
.
inbuf
,
inleft
,
r
=
codec
->
encode
(
state
,
codec
->
config
,
&
buf
.
inbuf
,
inleft
,
&
buf
.
outbuf
,
outleft
,
flags
);
&
buf
.
outbuf
,
outleft
,
flags
);
*
data
=
buf
.
inbuf
;
if
((
r
==
0
)
||
(
r
==
MBERR_TOOFEW
&&
!
(
flags
&
MBENC_FLUSH
)))
if
((
r
==
0
)
||
(
r
==
MBERR_TOOFEW
&&
!
(
flags
&
MBENC_FLUSH
)))
break
;
break
;
else
if
(
multibytecodec_encerror
(
codec
,
state
,
&
buf
,
errors
,
r
))
else
if
(
multibytecodec_encerror
(
codec
,
state
,
&
buf
,
errors
,
r
))
...
@@ -528,6 +527,7 @@ multibytecodec_encode(MultibyteCodec *codec,
...
@@ -528,6 +527,7 @@ multibytecodec_encode(MultibyteCodec *codec,
if
(
_PyString_Resize
(
&
buf
.
outobj
,
finalsize
)
==
-
1
)
if
(
_PyString_Resize
(
&
buf
.
outobj
,
finalsize
)
==
-
1
)
goto
errorexit
;
goto
errorexit
;
*
data
=
buf
.
inbuf
;
Py_XDECREF
(
buf
.
excobj
);
Py_XDECREF
(
buf
.
excobj
);
return
buf
.
outobj
;
return
buf
.
outobj
;
...
...
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