summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxi <xi@18f92427-320e-0410-9341-c67f048884a3>2008-12-30 18:18:53 +0000
committerxi <xi@18f92427-320e-0410-9341-c67f048884a3>2008-12-30 18:18:53 +0000
commit618b5fd1e4602311e6c041259d671a3e10009a4e (patch)
treee29522b562598f374e1a439819f4c9f64ef35cc4
parent18e56d688e73f8115bbe3413b3be16da077344e0 (diff)
downloadpyyaml-618b5fd1e4602311e6c041259d671a3e10009a4e.tar.gz
Final touches before the release.
git-svn-id: http://svn.pyyaml.org/pyyaml/trunk@336 18f92427-320e-0410-9341-c67f048884a3
-rw-r--r--CHANGES8
-rw-r--r--README3
-rw-r--r--announcement.msg49
-rw-r--r--lib/yaml/__init__.py2
-rw-r--r--lib3/yaml/__init__.py14
-rw-r--r--setup.py4
-rw-r--r--tests/lib3/test_input_output.py3
7 files changed, 50 insertions, 33 deletions
diff --git a/CHANGES b/CHANGES
index 2209b83..c44abfd 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,14 @@
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)
-----------------
diff --git a/README b/README
index 6336ad5..c1edf13 100644
--- a/README
+++ b/README
@@ -21,7 +21,7 @@ type 'python setup.py test'.
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:
@@ -32,3 +32,4 @@ Submit bug reports and feature requests to the PyYAML bug tracker:
PyYAML is written by Kirill Simonov <xi@resolvent.net>. It is released
under the MIT license. See the file LICENSE for more details.
+
diff --git a/announcement.msg b/announcement.msg
index 5278c0f..735c6ab 100644
--- a/announcement.msg
+++ b/announcement.msg
@@ -1,35 +1,31 @@
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
@@ -38,13 +34,14 @@ 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
diff --git a/lib/yaml/__init__.py b/lib/yaml/__init__.py
index c357d70..69c18c4 100644
--- a/lib/yaml/__init__.py
+++ b/lib/yaml/__init__.py
@@ -8,7 +8,7 @@ from nodes import *
from loader import *
from dumper import *
-__version__ = '3.07'
+__version__ = '3.08'
try:
from cyaml import *
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,
diff --git a/setup.py b/setup.py
index 3f396a9..295b622 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
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
@@ -81,6 +81,8 @@ if sys.version_info[0] < 3:
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'
diff --git a/tests/lib3/test_input_output.py b/tests/lib3/test_input_output.py
index 0018002..c32e25d 100644
--- a/tests/lib3/test_input_output.py
+++ b/tests/lib3/test_input_output.py
@@ -56,6 +56,9 @@ def test_unicode_output(unicode_filename, verbose=False):
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: