diff options
author | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2008-12-30 18:18:53 +0000 |
---|---|---|
committer | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2008-12-30 18:18:53 +0000 |
commit | 618b5fd1e4602311e6c041259d671a3e10009a4e (patch) | |
tree | e29522b562598f374e1a439819f4c9f64ef35cc4 /lib3/yaml/__init__.py | |
parent | 18e56d688e73f8115bbe3413b3be16da077344e0 (diff) | |
download | pyyaml-618b5fd1e4602311e6c041259d671a3e10009a4e.tar.gz |
Final touches before the release.
git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@336 18f92427-320e-0410-9341-c67f048884a3
Diffstat (limited to 'lib3/yaml/__init__.py')
-rw-r--r-- | lib3/yaml/__init__.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib3/yaml/__init__.py b/lib3/yaml/__init__.py index 55592e0..5401f9a 100644 --- a/lib3/yaml/__init__.py +++ b/lib3/yaml/__init__.py @@ -104,7 +104,7 @@ def emit(events, stream=None, Dumper=Dumper, def serialize_all(nodes, stream=None, Dumper=Dumper, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, - encoding='utf-8', explicit_start=None, explicit_end=None, + encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None): """ Serialize a sequence of representation trees into a YAML stream. @@ -112,7 +112,10 @@ def serialize_all(nodes, stream=None, Dumper=Dumper, """ getvalue = None if stream is None: - stream = io.StringIO() + if encoding is None: + stream = io.StringIO() + else: + stream = io.BytesIO() getvalue = stream.getvalue dumper = Dumper(stream, canonical=canonical, indent=indent, width=width, allow_unicode=allow_unicode, line_break=line_break, @@ -136,7 +139,7 @@ def dump_all(documents, stream=None, Dumper=Dumper, default_style=None, default_flow_style=None, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, - encoding='utf-8', explicit_start=None, explicit_end=None, + encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None): """ Serialize a sequence of Python objects into a YAML stream. @@ -144,7 +147,10 @@ def dump_all(documents, stream=None, Dumper=Dumper, """ getvalue = None if stream is None: - stream = io.StringIO() + if encoding is None: + stream = io.StringIO() + else: + stream = io.BytesIO() getvalue = stream.getvalue dumper = Dumper(stream, default_style=default_style, default_flow_style=default_flow_style, |