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
7f82f795
Kaydet (Commit)
7f82f795
authored
Kas 19, 2002
tarafından
Walter Dörwald
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add missing documentation for the PEP 293 functionality to
the codecs docstrings.
üst
a1a61f92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
codecs.py
Lib/codecs.py
+22
-7
No files found.
Lib/codecs.py
Dosyayı görüntüle @
7f82f795
...
@@ -67,15 +67,22 @@ class Codec:
...
@@ -67,15 +67,22 @@ class Codec:
""" Defines the interface for stateless encoders/decoders.
""" Defines the interface for stateless encoders/decoders.
The .encode()/.decode() methods may
implement
different error
The .encode()/.decode() methods may
use
different error
handling schemes by providing the errors argument. These
handling schemes by providing the errors argument. These
string values are defined:
string values are
pre
defined:
'strict' - raise a ValueError error (or a subclass)
'strict' - raise a ValueError error (or a subclass)
'ignore' - ignore the character and continue with the next
'ignore' - ignore the character and continue with the next
'replace' - replace with a suitable replacement character;
'replace' - replace with a suitable replacement character;
Python will use the official U+FFFD REPLACEMENT
Python will use the official U+FFFD REPLACEMENT
CHARACTER for the builtin Unicode codecs.
CHARACTER for the builtin Unicode codecs on
decoding and '?' on encoding.
'xmlcharrefreplace' - Replace with the appropriate XML
character reference (only for encoding).
'backslashreplace' - Replace with backslashed escape sequences
(only for encoding).
The set of allowed values can be extended via register_error.
"""
"""
def
encode
(
self
,
input
,
errors
=
'strict'
):
def
encode
(
self
,
input
,
errors
=
'strict'
):
...
@@ -136,14 +143,20 @@ class StreamWriter(Codec):
...
@@ -136,14 +143,20 @@ class StreamWriter(Codec):
stream must be a file-like object open for writing
stream must be a file-like object open for writing
(binary) data.
(binary) data.
The StreamWriter may
implement
different error handling
The StreamWriter may
use
different error handling
schemes by providing the errors keyword argument. These
schemes by providing the errors keyword argument. These
parameters are defined:
parameters are
pre
defined:
'strict' - raise a ValueError (or a subclass)
'strict' - raise a ValueError (or a subclass)
'ignore' - ignore the character and continue with the next
'ignore' - ignore the character and continue with the next
'replace'- replace with a suitable replacement character
'replace'- replace with a suitable replacement character
'xmlcharrefreplace' - Replace with the appropriate XML
character reference.
'backslashreplace' - Replace with backslashed escape
sequences (only for encoding).
The set of allowed parameter values can be extended via
register_error.
"""
"""
self
.
stream
=
stream
self
.
stream
=
stream
self
.
errors
=
errors
self
.
errors
=
errors
...
@@ -192,14 +205,16 @@ class StreamReader(Codec):
...
@@ -192,14 +205,16 @@ class StreamReader(Codec):
stream must be a file-like object open for reading
stream must be a file-like object open for reading
(binary) data.
(binary) data.
The StreamReader may
implement
different error handling
The StreamReader may
use
different error handling
schemes by providing the errors keyword argument. These
schemes by providing the errors keyword argument. These
parameters are defined:
parameters are
pre
defined:
'strict' - raise a ValueError (or a subclass)
'strict' - raise a ValueError (or a subclass)
'ignore' - ignore the character and continue with the next
'ignore' - ignore the character and continue with the next
'replace'- replace with a suitable replacement character;
'replace'- replace with a suitable replacement character;
The set of allowed parameter values can be extended via
register_error.
"""
"""
self
.
stream
=
stream
self
.
stream
=
stream
self
.
errors
=
errors
self
.
errors
=
errors
...
...
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