Package svnmailer :: Module stream :: Class UnicodeStream

[hide private]

# Class UnicodeStream

source code

     object --+
              |
    _BaseStream --+
                  |
                 UnicodeStream

Stream wrapper, which accepts unicode and a specified charset

Instance Methods | [hide private]

__init__(self, stream, in_enc=`'``utf-8``'`, out_enc=`'``utf-8``'`, errors=`'``replace``'`) Initialization | source code

write(self, towrite) Write a string or unicode | source code

Inherited from `_BaseStream`: `__getattr__`, `close`, `writelines` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Instance Variables | [hide private]

callable | decode Decoder function for the input encoding
`str` | err error handling advise
Inherited from `_BaseStream`: `stream`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, stream, in_enc=`'``utf-8``'`, out_enc=`'``utf-8``'`, errors=`'``replace``'`)
(Constructor)

source code

Initialization

Parameters:
  - `stream` (file like object) - The stream to wrap
  - `in_enc` (`str`) - The input encoding, that should be assumed, if a pure string is written
  - `out_enc` (`str`) - The output encoding
  - `errors` (`str`) - The error handling indicator, when an unicode error occurs. (The default is quite lenient and writes replace characters on errors)
Overrides: object.__init__

### write(self, towrite)

source code

Write a string or unicode

Parameters:
  - `towrite` - stuff to write
Overrides: _BaseStream.write