~ubuntu-branches/ubuntu/karmic/pypy/karmic

« back to all changes in this revision

Viewing changes to lib-python/modified-2.4.1/encodings/undefined.py

  • Committer: Bazaar Package Importer
  • Author(s): Alexandre Fayolle
  • Date: 2007-04-13 09:33:09 UTC
  • Revision ID: james.westby@ubuntu.com-20070413093309-yoojh4jcoocu2krz
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
""" Python 'undefined' Codec
 
2
 
 
3
    This codec will always raise a ValueError exception when being
 
4
    used. It is intended for use by the site.py file to switch off
 
5
    automatic string to Unicode coercion.
 
6
 
 
7
Written by Marc-Andre Lemburg (mal@lemburg.com).
 
8
 
 
9
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
 
10
 
 
11
"""
 
12
import codecs
 
13
 
 
14
### Codec APIs
 
15
 
 
16
class Codec(codecs.Codec):
 
17
 
 
18
    def encode(self,input,errors='strict'):
 
19
        raise UnicodeError, "undefined encoding"
 
20
 
 
21
    def decode(self,input,errors='strict'):
 
22
        raise UnicodeError, "undefined encoding"
 
23
 
 
24
class StreamWriter(Codec,codecs.StreamWriter):
 
25
    pass
 
26
 
 
27
class StreamReader(Codec,codecs.StreamReader):
 
28
    pass
 
29
 
 
30
### encodings module API
 
31
 
 
32
def getregentry():
 
33
 
 
34
    return (Codec().encode,Codec().decode,StreamReader,StreamWriter)