ยปCore Development>Code coverage>Lib/encodings/undefined.py

Python code coverage for Lib/encodings/undefined.py

#countcontent
1n/a""" Python 'undefined' Codec
2n/a
3n/a This codec will always raise a ValueError exception when being
4n/a used. It is intended for use by the site.py file to switch off
5n/a automatic string to Unicode coercion.
6n/a
7n/aWritten by Marc-Andre Lemburg (mal@lemburg.com).
8n/a
9n/a(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
10n/a
11n/a"""
12n/aimport codecs
13n/a
14n/a### Codec APIs
15n/a
16n/aclass Codec(codecs.Codec):
17n/a
18n/a def encode(self,input,errors='strict'):
19n/a raise UnicodeError("undefined encoding")
20n/a
21n/a def decode(self,input,errors='strict'):
22n/a raise UnicodeError("undefined encoding")
23n/a
24n/aclass IncrementalEncoder(codecs.IncrementalEncoder):
25n/a def encode(self, input, final=False):
26n/a raise UnicodeError("undefined encoding")
27n/a
28n/aclass IncrementalDecoder(codecs.IncrementalDecoder):
29n/a def decode(self, input, final=False):
30n/a raise UnicodeError("undefined encoding")
31n/a
32n/aclass StreamWriter(Codec,codecs.StreamWriter):
33n/a pass
34n/a
35n/aclass StreamReader(Codec,codecs.StreamReader):
36n/a pass
37n/a
38n/a### encodings module API
39n/a
40n/adef getregentry():
41n/a return codecs.CodecInfo(
42n/a name='undefined',
43n/a encode=Codec().encode,
44n/a decode=Codec().decode,
45n/a incrementalencoder=IncrementalEncoder,
46n/a incrementaldecoder=IncrementalDecoder,
47n/a streamwriter=StreamWriter,
48n/a streamreader=StreamReader,
49n/a )