Mercurial > genshi > mirror
comparison genshi/output.py @ 932:18209925c54e trunk
Merge r1140 from py3k:
add support for python 3 to core genshi components (genshi.core, genshi.input and genshi.output):
* default input and output encodings changed from UTF-8 to None (i.e. unicode strings)
* Namespace and QName objects do not call stringrepr in __repr__ in Python 3 since repr() returns a unicode string there.
* track changes to expat parser in Python 3 (mostly it accepts bytes instead of strings)
author | hodgestar |
---|---|
date | Fri, 18 Mar 2011 09:08:12 +0000 |
parents | 869ca3cc2f4c |
children | 8d0f693081b5 |
comparison
equal
deleted
inserted
replaced
931:3f8fb83045b9 | 932:18209925c54e |
---|---|
25 __all__ = ['encode', 'get_serializer', 'DocType', 'XMLSerializer', | 25 __all__ = ['encode', 'get_serializer', 'DocType', 'XMLSerializer', |
26 'XHTMLSerializer', 'HTMLSerializer', 'TextSerializer'] | 26 'XHTMLSerializer', 'HTMLSerializer', 'TextSerializer'] |
27 __docformat__ = 'restructuredtext en' | 27 __docformat__ = 'restructuredtext en' |
28 | 28 |
29 | 29 |
30 def encode(iterator, method='xml', encoding='utf-8', out=None): | 30 def encode(iterator, method='xml', encoding=None, out=None): |
31 """Encode serializer output into a string. | 31 """Encode serializer output into a string. |
32 | 32 |
33 :param iterator: the iterator returned from serializing a stream (basically | 33 :param iterator: the iterator returned from serializing a stream (basically |
34 any iterator that yields unicode objects) | 34 any iterator that yields unicode objects) |
35 :param method: the serialization method; determines how characters not | 35 :param method: the serialization method; determines how characters not |