Kirill Simonov avatar Kirill Simonov committed 8c1d3a1

Final touches before the release.

Comments (0)

Files changed (7)

 For a complete Subversion changelog, see 'http://pyyaml.org/log/pyyaml'.
 
 
+3.08 (2008-12-31)
+-----------------
+
+* Python 3 support (Thank to Erick Tryzelaar).
+* Use Cython instead of Pyrex to build LibYAML bindings.
+* Refactored support for unicode and byte input/output streams.
+
+
 3.07 (2008-12-29)
 -----------------
 
 For more information, check the PyYAML homepage:
 'http://pyyaml.org/wiki/PyYAML'.
 
-Documentation (rough and incomplete though):
+For PyYAML tutorial and reference, see:
 'http://pyyaml.org/wiki/PyYAMLDocumentation'.
 
 Post your questions and opinions to the YAML-Core mailing list:
 
 PyYAML is written by Kirill Simonov <xi@resolvent.net>.  It is released
 under the MIT license. See the file LICENSE for more details.
+
 From: Kirill Simonov <xi@gamma.dn.ua>
-To: python-list@python.org, python-announce@python.org, yaml-core@lists.sourceforge.net
-Subject: [ANN] PyYAML-3.07: YAML parser and emitter for Python
+To: python-list@python.org, python-announce@python.org, yaml-core@lists.sourceforge.net, python-porting@python.org
+Subject: [ANN] PyYAML-3.08: Now with Python 3 support
 
 ========================
- Announcing PyYAML-3.07
+ Announcing PyYAML-3.08
 ========================
 
 A new release of PyYAML is now available:
 
     http://pyyaml.org/wiki/PyYAML
 
+This release features a complete support for Python 3.  For
+compatibility notes between Python 2 and Python 3 versions,
+please see
+
+    http://pyyaml.org/wiki/PyYAMLDocumentation#Python3support
+
 
 Changes
 =======
 
-* The emitter learned to use an optional indentation indicator
-  for block scalar; thus scalars with leading whitespaces
-  could now be represented in a literal or folded style.
-* The test suite is now included in the source distribution.
-  To run the tests, type 'python setup.py test'.
-* Refactored the test suite: dropped unittest in favor of
-  a custom test appliance.
-* Fixed the path resolver in the LibYAML-based dumper.
-* Forced an explicit document end indicator when there is
-  a possibility of parsing ambiguity.
-* More setup.py improvements: the package should be usable
-  when any combination of setuptools, Pyrex and LibYAML
-  is installed.
-* Windows binary packages are built against LibYAML-0.1.2.
-* Other minor fixes and improvements (Thank to Ingy dot Net
-  and Andrey Somov).
+* Python 3 support (Thank to Erick Tryzelaar).
+* Use Cython instead of Pyrex to build LibYAML bindings.  Note
+  that the source package is distributed with a pre-generated
+  '_yaml.c' file so you don't need Cython installed to build
+  LibYAML bindings.
+* Refactored support for unicode and byte input/output streams.
 
 
 Resources
 PyYAML homepage: http://pyyaml.org/wiki/PyYAML
 PyYAML documentation: http://pyyaml.org/wiki/PyYAMLDocumentation
 
-TAR.GZ package: http://pyyaml.org/download/pyyaml/PyYAML-3.07.tar.gz
-ZIP package: http://pyyaml.org/download/pyyaml/PyYAML-3.07.zip
-Windows installer:
-    http://pyyaml.org/download/pyyaml/PyYAML-3.07.win32-py2.3.exe
-    http://pyyaml.org/download/pyyaml/PyYAML-3.07.win32-py2.4.exe
-    http://pyyaml.org/download/pyyaml/PyYAML-3.07.win32-py2.5.exe
-    http://pyyaml.org/download/pyyaml/PyYAML-3.07.win32-py2.6.exe
+TAR.GZ package: http://pyyaml.org/download/pyyaml/PyYAML-3.08.tar.gz
+ZIP package: http://pyyaml.org/download/pyyaml/PyYAML-3.08.zip
+Windows installers:
+    http://pyyaml.org/download/pyyaml/PyYAML-3.08.win32-py2.3.exe
+    http://pyyaml.org/download/pyyaml/PyYAML-3.08.win32-py2.4.exe
+    http://pyyaml.org/download/pyyaml/PyYAML-3.08.win32-py2.5.exe
+    http://pyyaml.org/download/pyyaml/PyYAML-3.08.win32-py2.6.exe
+    http://pyyaml.org/download/pyyaml/PyYAML-3.08.win32-py3.0.exe
 
 PyYAML SVN repository: http://svn.pyyaml.org/pyyaml
 Submit a bug report: http://pyyaml.org/newticket?component=pyyaml

lib/yaml/__init__.py

 from loader import *
 from dumper import *
 
-__version__ = '3.07'
+__version__ = '3.08'
 
 try:
     from cyaml import *

lib3/yaml/__init__.py

 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.
     """
     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,
         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.
     """
     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,
 
 NAME = 'PyYAML'
-VERSION = '3.07'
+VERSION = '3.08'
 DESCRIPTION = "YAML parser and emitter for Python"
 LONG_DESCRIPTION = """\
 YAML is a data serialization format designed for human readability and
         with_pyrex = 'cython'
     except ImportError:
         try:
+            # Pyrex cannot build _yaml.c at the moment,
+            # but it may get fixed eventually.
             from Pyrex.Distutils import Extension as _Extension
             from Pyrex.Distutils import build_ext as _build_ext
             with_pyrex = 'pyrex'

tests/lib3/test_input_output.py

             yaml.dump(value, stream, encoding=encoding, allow_unicode=allow_unicode)
             data2 = stream.getvalue()
             data3 = yaml.dump(value, encoding=encoding, allow_unicode=allow_unicode)
+            if encoding is not None:
+                assert isinstance(data3, bytes)
+                data3 = data3.decode(encoding)
             stream = io.BytesIO()
             if encoding is None:
                 try:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.