__group__	ticket	summary	component	version	milestone	type	severity	owner	status	created	_changetime	_description	_reporter
Active Tickets	160	Windows 7	libyaml			defect	major	xi	new	2010-05-07T20:41:54-04:00	2011-06-08T16:46:44-04:00	"Cannot make under Windows 7 32-bit, using MSYS.
Here is the output:

{{{
pavel@VISTA /c/ngplayer/cots/yaml-0.1.3
$ make
make  all-recursive
make[1]: Entering directory `/c/ngplayer/cots/yaml-0.1.3'
Making all in include
make[2]: Entering directory `/c/ngplayer/cots/yaml-0.1.3/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/c/ngplayer/cots/yaml-0.1.3/include'
Making all in src
make[2]: Entering directory `/c/ngplayer/cots/yaml-0.1.3/src'
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I../
include   -g -O2 -MT api.lo -MD -MP -MF .deps/api.Tpo -c -o api.lo api.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -MT api.lo -
MD -MP -MF .deps/api.Tpo -c api.c  -DDLL_EXPORT -DPIC -o .libs/api.o
api.c:579: error: failure in redeclaration of 'yaml_token_delete': dllimport'd s
ymbol lacks external linkage.
api.c:579: confused by earlier errors, bailing out
make[2]: *** [api.lo] Error 1
make[2]: Leaving directory `/c/ngplayer/cots/yaml-0.1.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c/ngplayer/cots/yaml-0.1.3'
make: *** [all] Error 2

pavel@VISTA /c/ngplayer/cots/yaml-0.1.3
$
}}}"	paveltbonev@…
Active Tickets	247	PyYaml uses int instead of size_t in ext	pyyaml			defect	blocker	xi	new	2012-06-11T21:49:16-04:00	2012-06-11T21:49:16-04:00	PyYaml fails to build on the s390x architecture.  It seems this is due to using int where the libyaml API uses size_t. The attached patch has been applied in Debian and Ubuntu and resolves the issue.	debian@…
Active Tickets	128	libyaml should detect duplicate keys and report an error.	libyaml			defect	major	xi	new	2009-06-02T19:00:04-04:00	2012-03-29T06:40:17-04:00	In the 1.1 spec I believe this is considered an error; currently libyaml silently accepts duplicate keys.	anonymous
Active Tickets	196	Uneccessry use of explict non-specific tags	libyaml			enhancement	normal	xi	new	2011-07-28T12:05:49-04:00	2011-07-28T12:07:56-04:00	"I recently noticed that libyaml is putting an explicit non-specific tag on every string that has characters that need to be escaped. For example:

  - ""This is an 'example'.""

Comes back as:

  - ! 'This is an ''example''.'

The `!` sign is gratuitous, as it is completely unnecessary. For documents that humans may need to read it greatly detracts from readability, so it would be nice to see these go away.

Also, I suspect it may have more subtle issues since the `!` tag can be redefined in a %TAG directive. I haven't tested it but does libyaml take that into account here? Maybe it does, but I could see that easily being overlooked since the `!` isn't needed in the first place.
"	anonymous
Active Tickets	204	In pure-python implementation yaml.load cannot read files generated by yaml.dump/safe_dump when allow_unicode=True	pyyaml			defect	normal	xi	new	2011-10-01T18:13:58-04:00	1969-12-31T19:00:00-05:00	"Consider we're running:

{{{
Jython 2.5.1+ (Release_2_5_1, Aug 4 2010, 07:18:19) 
[OpenJDK 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_23
Type ""help"", ""copyright"", ""credits"" or ""license"" for more information.
>>> import yaml; yaml.__version__
'3.10'
>>> f = file('tmp.yaml', 'wb')
>>> yaml.dump(u'Even just latin in unicode', allow_unicode=True)
""!!python/unicode 'Even just latin in unicode'\n""
>>> yaml.dump(u'Even just latin in unicode', f, allow_unicode=True)
>>> f.close()
>>> f = file('tmp.yaml')
>>> yaml.load(f)
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/usr/share/jython/Lib/site-packages/yaml/__init__.py"", line 69, in load
  File ""/usr/share/jython/Lib/site-packages/yaml/loader.py"", line 34, in __init__
  File ""/usr/share/jython/Lib/site-packages/yaml/reader.py"", line 85, in __init__
  File ""/usr/share/jython/Lib/site-packages/yaml/reader.py"", line 135, in determine_encoding
  File ""/usr/share/jython/Lib/site-packages/yaml/reader.py"", line 169, in update
  File ""/usr/share/jython/Lib/site-packages/yaml/reader.py"", line 143, in check_printable
yaml.reader.ReaderError: unacceptable character #x0000: special characters are not allowed
  in ""tmp.yaml"", position 16
}}}

In cpython (with yaml with c-extension) yaml.load works with this file."	kpp.live@…
Active Tickets	239	Using yaml.dump() after yaml.load() creates different document for block and folded literals	pyyaml			defect	normal	xi	new	2012-05-09T06:45:14-04:00	2012-05-09T06:45:14-04:00	"Hi, 

With folded and block scalars, a document can not be loaded into python code and then dumped as the same. Why?

What I expect is like that: 


{{{ 
# original document
a: |
  this is an 
  example
  block

b: > 
  this is another
  example
  block
}}}

Using this code: 
{{{
f = open(original_document)
result = yaml.dump(yaml.load(f.read()))
f.write(result)
}}}

Expected result: 
{{{ 
# expected result document
a: |
  this is an 
  example
  block

b: > 
  this is another
  example
  block
}}}

{{{ 
# real result
a: 'this is an

  example

  block

  '
b: 'this is another example block

  '
}}}

Yes, there are some other questions on the web (http://stackoverflow.com/questions/8640959/how-can-i-control-what-scalar-form-pyyaml-uses-for-my-data) but accepted answers does not satisfy my needs.

Am I missing something?
"	ceremcem@…
Active Tickets	138	Patch to read/write invalid UTF-8	libyaml			enhancement	blocker	xi	new	2009-08-19T14:42:08-04:00	2009-08-19T14:55:13-04:00	"Would like to losslessly store arbitrary byte strings in files in fields that are *LIKELY* to be text (and thus we would like it to be visible/editable as text). This is impossible unless invalid UTF-8 is allowed. Obvious examples are URLs, Unix filenames, strings that are not actually UTF-8 stored in fields expected to be UTF-8, etc.

The following patch encodes each byte of an invalid portion of UTF-8 as a new \XNN sequence (capital 'X'), so the output file is legal UTF-8 and can also be written in UTF-16 form. It also removes the output of \xNN (it writes \u00NN instead) so that this escape may be used for this in the future. The reader is modified to accept \XNN and also to accept raw invalid UTF-8 strings from a UTF-8 encoded input file.

This patch also makes it read/write invalid UTF-16, which can easily occur in Windows filenames and other apis that use 16-bit words for strings. This has not been tested much as I am not using it, but was a simple fix to just remove the validity tests.

It also reads/writes invalid UTF-8 in tags, by printing all the bytes with %NN notation. This matches how invalid UTF-8 in URL's are done.

Considerable simplification by moving by single bytes in all cases where it knows the character is one byte or it knows that the pattern it is testing against will fail when pointing at the middle of a UTF-8 string. In most cases you do not need to know the width of the characters to process UTF-8.

"	spitzak@…
Active Tickets	141	easy_install failure on 64 bit ubuntu	pyyaml			defect	major	xi	new	2009-09-24T17:11:37-04:00	2009-11-08T14:42:57-05:00	"""easy_isntall pyyaml"" doesn't work.  The zip file fails to include a yaml.h file, leading to a bunch of compilation errors that I chopped.  Either (preferably) any necessary headers should be included in the easy_install, or else the easy_install should check for their absence and say where to get them.

$ sudo easy_install pyyaml
Searching for pyyaml
Reading http://pypi.python.org/simple/pyyaml/
Reading http://pyyaml.org/wiki/PyYAML
Best match: PyYAML 3.09
Downloading http://pyyaml.org/download/pyyaml/PyYAML-3.09.zip
Processing PyYAML-3.09.zip
Running PyYAML-3.09/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ei0gpu/PyYAML-3.09/egg-dist-tmp-2VXmew
build/temp.linux-x86_64-2.5/check_libyaml.c:2:18: error: yaml.h: No such file or directory
build/temp.linux-x86_64-2.5/check_libyaml.c: In function ‘main’:
"	solrize
Active Tickets	203	reading yaml from socket may block in determine_encoding()	pyyaml			defect	major	xi	new	2011-09-26T16:20:09-04:00	2011-09-26T16:41:04-04:00	"The problem here:

reader.py:

determine_encoding():
   1. call self.update_raw() until receive needed length. 
      Suppose it receives all data from the kernel buffer, i.e. in my case - full document (--- xxxxxxxx\n...\n)
      self.eof will not be set
   2. call update(1) which have the code:
      if not self.eof:
          self.update_raw()
      as the self.eof is False (we never receive empty string)
      we will hang for any (uneeded here) data.
###############################
How to fix: just remove
-------------
if not self.eof:
    self.update_raw()
-------------
"	socketpair@…
Active Tickets	221	add_implicit_resolver on a subclass may affect super_class resolvers	pyyaml			defect	major	xi	new	2012-01-04T03:41:29-05:00	1969-12-31T19:00:00-05:00	"Normally if I add a new implicit resolver to a subclass of a loader,
super class shall not be affected.

Yet this is the case if some letter of first argument matches an existing
implicit resolver in super.


{{{
>>> import yaml
>>> import re

>>> class DummyLoader(yaml.SafeLoader):
...     pass
...
>>> DummyLoader.add_implicit_resolver(u'!yeah',re.compile(ur'Yeah'),
... first='Y')  # first is the same as bool implicit resolver of SafeLoader

>>> yaml.safe_load('Yeah') # I use SafeLoader which shall ignore !yeah
Traceback (most recent call last):
...
yaml.constructor.ConstructorError: could not determine a constructor for the tag '!yeah'
  in ""<string>"", line 1, column 1:
    Yeah

}}}

This comes from line 26-27 of `resolver.py:BaseResolver.add_implicit_resolver`:

{{{
        if not 'yaml_implicit_resolvers' in cls.__dict__:
            cls.yaml_implicit_resolvers = cls.yaml_implicit_resolvers.copy()
}}}

`cls.yaml_implicit_resolvers.copy()` is not enough as it will keep existing lists
instead of cloning them.

Instead this shall be:

{{{
from copy import copy
}}}

then:

{{{
        if not 'yaml_implicit_resolvers' in cls.__dict__:
            cls.yaml_implicit_resolvers = {}
            for k, v in cls.yaml_implicit_resolvers.items():
                cls.yaml_implicit_resolvers[k] = copy(v)
}}}

"	Alex Garel <alex.garel@…>
Active Tickets	245	support for Abstract Base Classes	pyyaml			defect	major	xi	new	2012-06-04T15:55:59-04:00	2012-06-04T15:55:59-04:00	"== problem ==

{{{

>>> import yaml
>>> from collections import Mapping
>>> class A(Mapping):
...     pass
... 
>>> yaml.dump(A)
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/tmp/yaml/lib/python2.7/site-packages/yaml/__init__.py"", line 202, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
  File ""/tmp/yaml/lib/python2.7/site-packages/yaml/__init__.py"", line 190, in dump_all
    dumper.represent(data)
  File ""/tmp/yaml/lib/python2.7/site-packages/yaml/representer.py"", line 28, in represent
    node = self.represent_data(data)
  File ""/tmp/yaml/lib/python2.7/site-packages/yaml/representer.py"", line 61, in represent_data
    node = self.yaml_multi_representers[data_type](self, data)
  File ""/tmp/yaml/lib/python2.7/site-packages/yaml/representer.py"", line 408, in represent_object
    reduce = data.__reduce_ex__(2)
  File ""/tmp/yaml/lib/python2.7/copy_reg.py"", line 70, in _reduce_ex
    raise TypeError, ""can't pickle %s objects"" % base.__name__
TypeError: can't pickle int objects
}}}

== analysis ==

This is because of A being handled as an object, so an unbind version {{{ object.__reduce_ex__ }}} is called, so protocol version is mistaken with the object (2 is passed in place of self).

{{{

>>> type(A)
<class 'abc.ABCMeta'>

}}}

== solution ==

{{{

>>> from yaml.representer import Representer
>>> from abc import ABCMeta
>>> Representer.add_representer(ABCMeta, Representer.represent_name)
>>> yaml.dump(A)
""!!python/name:__main__.A ''\n""


}}}"	alex.garel@…
Active Tickets	19	PySyck improperly handles subclassed types	pysyck			defect	normal	xi	new	2006-07-12T19:57:11-04:00	1969-12-31T19:00:00-05:00	"If you derive from set, list, or dict, PySyck ignores the __getstate__ method in the new class.  This makes it more difficult to create a slightly custom data type for two reasons:
 1. The original data type is not preserved.
 2. Any customization in the data storage is not obeyed.

I haven't had a chance to examine the source code at this point, but I suspect that the dict/list/set types are checked for (probably via isinstance) before the __getstate__ protocol is checked.

Two examples of the type being lost:
{{{
>>> class OrderedSet(set):
...  def __iter__(self):
...   items = list( set.__iter__(self) )
...   items.sort( key=str )
...   for item in items:
...     yield item
...   return
...  def __getstate__(self):
...   return {'ordered_items': set(self)}
...
>>> x = OrderedSet( ('Apples', 'Bananas', 'Cucumbers') )
>>> x
OrderedSet(['Apples', 'Cucumbers', 'Bananas'])
>>> print syck.dump(x)
--- !set
- Apples
- Bananas
- Cucumbers

>>> class DefaultDict(dict):
...  def __init__(self, default, *args, **keyargs):
...   self.default = default
...   dict.__init__(self, *args, **keyargs)
...  def __getstate__(self):
...   return {'default': self.default, 'dict': dict(self) }
...
>>> d = DefaultDict(-1, test='Hello!')
>>> d.__getstate__()
{'default': -1, 'dict': {'test': 'Hello!'}}
>>> print syck.dump(d)
---
test: Hello!

>>>
}}}

An example of a regular object with the __getstate__() method being properly called:
{{{
>>> class RegularObject(object):
...  def __init__(self, name, value):
...   self.name, self.value = name, value
...  def __getstate__(self):
...   return {'sillyName': self.name, 'badValue': self.value}
...
>>> a = RegularObject('Answer To Life', 42)
>>> a.__getstate__()
{'badValue': 42, 'sillyName': 'Answer To Life'}
>>> print syck.dump(a)
--- !python/object:__main__.RegularObject
badValue: 42
sillyName: Answer To Life
}}}"	tenax.raccoon@…
Active Tickets	20	Better Support for Numeric, and NumPy	pyyaml			defect	normal	xi	new	2006-07-14T15:50:50-04:00	2006-07-14T15:50:50-04:00	"Would like better support for Numeric and NumPy.
In the old pyYaml created an extension that would correctly output Numeric arrays
as a redable list. Would be nice if the baseline version of Yaml could do the same.
{{{ 
--- !!Numeric.array
  - 1.0
  - 2.0
  - 3.0
}}}

{{{
$ grep -A 10 ECS ""c:\python24\lib\site-packages\yaml\constructor.py""
    #ECS added
    def construct_Numeric_array(self, node):
        from numpy import array
        if not isinstance(node, SequenceNode):
            raise ConstructorError(None, None,
                    ""expected a sequence node, but found %s"" % node.id,
                    node.start_mark)
        return array([self.construct_object(child) for child in node.value])

    def construct_mapping(self, node):
        if not isinstance(node, MappingNode):
--
    #ECS added
    def construct_yaml_Numeric_array(self, node):
        return self.construct_Numeric_array(node)

    def construct_yaml_map(self, node):
        return self.construct_mapping(node)

    def construct_yaml_object(self, node, cls):
        state = self.construct_mapping(node)
        data = cls.__new__(cls)
        if hasattr(data, '__setstate__'):
--
#ECS added
SafeConstructor.add_constructor(
        u'tag:yaml.org,2002:Numeric.array',
        SafeConstructor.construct_yaml_Numeric_array)

SafeConstructor.add_constructor(None,
        SafeConstructor.construct_undefined)

class Constructor(SafeConstructor):

    def construct_python_str(self, node):
}}}"	Numeric
Active Tickets	56	pysyck install problem	pysyck			defect	normal	xi	new	2007-07-02T23:58:42-04:00	2011-11-21T11:15:28-05:00	"I installed the patched unofficial syck 0.61 and the pysyck 0.61.2  using  python 2.5 on a mac osx 10.4.8 on a G4 powerbook.

when i try to import pysyck into python2.5 (installed via fink) I get the following error:

{{{
In [1]: import syck

<type 'exceptions.ImportError'>           Traceback (most recent call last)

/Users/cems/<ipython console> in <module>()

/sw/lib/python2.5/site-packages/syck/__init__.py in <module>()
    100 
    101 
--> 102 from _syck import *
    103 from loaders import *
    104 from dumpers import *

<type 'exceptions.ImportError'>: dlopen(/sw/lib/python2.5/site-packages/_syck.so, 2): Symbol not found: _syck_emit_map
  Referenced from: /sw/lib/python2.5/site-packages/_syck.so
  Expected in: dynamic lookup

}}}

The install of pysyck does not produce error messages but the make of the patched syck does produce warnings.

here is the install output from the pysyck and syck installs:
{{{
 python setup.py install
running install
running build
running build_py
running build_ext
checking for syck.h
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/sw/include/python2.5 -c ./_check_syck.c -o ./_check_syck.o
checking for libsyck.a
gcc ./_check_syck.o -lsyck -o ./_check_syck
checking syck version
syck version: 0.61
running install_lib
running install_egg_info
Removing /sw/lib/python2.5/site-packages/PySyck-0.61.2-py2.5.egg-info
Writing /sw/lib/python2.5/site-packages/PySyck-0.61.2-py2.5.egg-info

}}}

here is the make and install of syck

{{{

make
make  all-recursive
Making all in lib
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT emitter.o -MD -MP -MF "".deps/emitter.Tpo"" -c -o emitter.o emitter.c; \
then mv -f "".deps/emitter.Tpo"" "".deps/emitter.Po""; else rm -f "".deps/emitter.Tpo""; exit 1; fi
emitter.c: In function 'syck_base64enc':
emitter.c:32: warning: incompatible implicit declaration of built-in function 'malloc'
emitter.c: In function 'syck_new_emitter':
emitter.c:110: warning: incompatible implicit declaration of built-in function 'malloc'
emitter.c: In function 'syck_emitter_clear':
emitter.c:271: warning: incompatible implicit declaration of built-in function 'malloc'
emitter.c: In function 'syck_emit':
emitter.c:372: warning: incompatible implicit declaration of built-in function 'malloc'
emitter.c:405: warning: incompatible implicit declaration of built-in function 'malloc'
emitter.c:423: warning: incompatible implicit declaration of built-in function 'malloc'
emitter.c: In function 'syck_emit_indent':
emitter.c:506: warning: incompatible implicit declaration of built-in function 'malloc'
emitter.c: In function 'syck_emit_item':
emitter.c:1136: warning: incompatible implicit declaration of built-in function 'malloc'
emitter.c: In function 'syck_emitter_mark_node':
emitter.c:1259: warning: incompatible implicit declaration of built-in function 'malloc'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT handler.o -MD -MP -MF "".deps/handler.Tpo"" -c -o handler.o handler.c; \
then mv -f "".deps/handler.Tpo"" "".deps/handler.Po""; else rm -f "".deps/handler.Tpo""; exit 1; fi
handler.c: In function 'syck_xprivate':
handler.c:149: warning: incompatible implicit declaration of built-in function 'malloc'
handler.c: In function 'syck_taguri':
handler.c:159: warning: incompatible implicit declaration of built-in function 'malloc'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT node.o -MD -MP -MF "".deps/node.Tpo"" -c -o node.o node.c; \
then mv -f "".deps/node.Tpo"" "".deps/node.Po""; else rm -f "".deps/node.Tpo""; exit 1; fi
node.c: In function 'syck_alloc_node':
node.c:20: warning: incompatible implicit declaration of built-in function 'malloc'
node.c: In function 'syck_alloc_map':
node.c:53: warning: incompatible implicit declaration of built-in function 'malloc'
node.c: In function 'syck_alloc_seq':
node.c:72: warning: incompatible implicit declaration of built-in function 'malloc'
node.c: In function 'syck_alloc_str':
node.c:90: warning: incompatible implicit declaration of built-in function 'malloc'
node.c: In function 'syck_new_str2':
node.c:113: warning: incompatible implicit declaration of built-in function 'malloc'
node.c: In function 'syck_replace_str2':
node.c:137: warning: incompatible implicit declaration of built-in function 'malloc'
node.c: In function 'syck_map_empty':
node.c:192: warning: incompatible implicit declaration of built-in function 'malloc'
node.c: In function 'syck_seq_empty':
node.c:316: warning: incompatible implicit declaration of built-in function 'malloc'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT syck.o -MD -MP -MF "".deps/syck.Tpo"" -c -o syck.o syck.c; \
then mv -f "".deps/syck.Tpo"" "".deps/syck.Po""; else rm -f "".deps/syck.Tpo""; exit 1; fi
syck.c: In function 'syck_assert':
syck.c:26: warning: incompatible implicit declaration of built-in function 'abort'
syck.c: In function 'syck_strndup':
syck.c:35: warning: incompatible implicit declaration of built-in function 'malloc'
syck.c: In function 'syck_parser_reset_cursor':
syck.c:122: warning: incompatible implicit declaration of built-in function 'malloc'
syck.c: In function 'syck_new_parser':
syck.c:159: warning: incompatible implicit declaration of built-in function 'malloc'
syck.c: In function 'syck_parser_file':
syck.c:302: warning: incompatible implicit declaration of built-in function 'malloc'
syck.c: In function 'syck_parser_str':
syck.c:321: warning: incompatible implicit declaration of built-in function 'malloc'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT syck_st.o -MD -MP -MF "".deps/syck_st.Tpo"" -c -o syck_st.o syck_st.c; \
then mv -f "".deps/syck_st.Tpo"" "".deps/syck_st.Po""; else rm -f "".deps/syck_st.Tpo""; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT gram.o -MD -MP -MF "".deps/gram.Tpo"" -c -o gram.o gram.c; \
then mv -f "".deps/gram.Tpo"" "".deps/gram.Po""; else rm -f "".deps/gram.Tpo""; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT bytecode.o -MD -MP -MF "".deps/bytecode.Tpo"" -c -o bytecode.o bytecode.c; \
then mv -f "".deps/bytecode.Tpo"" "".deps/bytecode.Po""; else rm -f "".deps/bytecode.Tpo""; exit 1; fi
bytecode.re: In function 'sycklex_bytecode_utf8':
bytecode.re:326: warning: incompatible implicit declaration of built-in function 'malloc'
bytecode.re:346: warning: incompatible implicit declaration of built-in function 'malloc'
bytecode.re:354: warning: incompatible implicit declaration of built-in function 'malloc'
bytecode.re:425: warning: incompatible implicit declaration of built-in function 'malloc'
bytecode.re: In function 'get_inline':
bytecode.re:497: warning: incompatible implicit declaration of built-in function 'malloc'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT yaml2byte.o -MD -MP -MF "".deps/yaml2byte.Tpo"" -c -o yaml2byte.o yaml2byte.c; \
then mv -f "".deps/yaml2byte.Tpo"" "".deps/yaml2byte.Po""; else rm -f "".deps/yaml2byte.Tpo""; exit 1; fi
yaml2byte.c: In function 'bytestring_alloc':
yaml2byte.c:40: warning: incompatible implicit declaration of built-in function 'malloc'
yaml2byte.c: In function 'syck_yaml2byte_handler':
yaml2byte.c:142: warning: incompatible implicit declaration of built-in function 'malloc'
yaml2byte.c: In function 'syck_yaml2byte':
yaml2byte.c:230: warning: incompatible implicit declaration of built-in function 'malloc'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT token.o -MD -MP -MF "".deps/token.Tpo"" -c -o token.o token.c; \
then mv -f "".deps/token.Tpo"" "".deps/token.Po""; else rm -f "".deps/token.Tpo""; exit 1; fi
token.re: In function 'sycklex_yaml_utf8':
token.re:528: warning: incompatible implicit declaration of built-in function 'malloc'
token.re:641: warning: incompatible implicit declaration of built-in function 'malloc'
token.re:729: warning: incompatible implicit declaration of built-in function 'malloc'
token.re:834: warning: incompatible implicit declaration of built-in function 'malloc'
token.re:920: warning: incompatible implicit declaration of built-in function 'malloc'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I..    -g -O2 -MT implicit.o -MD -MP -MF "".deps/implicit.Tpo"" -c -o implicit.o implicit.c; \
then mv -f "".deps/implicit.Tpo"" "".deps/implicit.Po""; else rm -f "".deps/implicit.Tpo""; exit 1; fi
implicit.re: In function 'syck_type_id_to_uri':
implicit.re:178: warning: incompatible implicit declaration of built-in function 'malloc'
implicit.re:191: warning: incompatible implicit declaration of built-in function 'malloc'
rm -f libsyck.a
ar cru libsyck.a emitter.o handler.o node.o syck.o syck_st.o gram.o bytecode.o yaml2byte.o token.o implicit.o 
ranlib libsyck.a
Making all in tests
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib    -g -O2 -MT Basic.o -MD -MP -MF "".deps/Basic.Tpo"" -c -o Basic.o Basic.c; \
then mv -f "".deps/Basic.Tpo"" "".deps/Basic.Po""; else rm -f "".deps/Basic.Tpo""; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib    -g -O2 -MT CuTest.o -MD -MP -MF "".deps/CuTest.Tpo"" -c -o CuTest.o CuTest.c; \
then mv -f "".deps/CuTest.Tpo"" "".deps/CuTest.Po""; else rm -f "".deps/CuTest.Tpo""; exit 1; fi
gcc  -g -O2  -L../lib -o test-basic  Basic.o CuTest.o -lsyck 
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib    -g -O2 -MT Parse.o -MD -MP -MF "".deps/Parse.Tpo"" -c -o Parse.o Parse.c; \
then mv -f "".deps/Parse.Tpo"" "".deps/Parse.Po""; else rm -f "".deps/Parse.Tpo""; exit 1; fi
gcc  -g -O2  -L../lib -o test-parse  Parse.o CuTest.o -lsyck 
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib    -g -O2 -MT YTS.o -MD -MP -MF "".deps/YTS.Tpo"" -c -o YTS.o YTS.c; \
then mv -f "".deps/YTS.Tpo"" "".deps/YTS.Po""; else rm -f "".deps/YTS.Tpo""; exit 1; fi
YTS.c: In function 'syck_copy_handler':
YTS.c:44: warning: incompatible implicit declaration of built-in function 'malloc'
YTS.c: In function 'CuStreamCompare':
YTS.c:143: warning: incompatible implicit declaration of built-in function 'malloc'
gcc  -g -O2  -L../lib -o test-yts  YTS.o CuTest.o -lsyck 
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib    -g -O2 -MT Emit.o -MD -MP -MF "".deps/Emit.Tpo"" -c -o Emit.o Emit.c; \
then mv -f "".deps/Emit.Tpo"" "".deps/Emit.Po""; else rm -f "".deps/Emit.Tpo""; exit 1; fi
gcc  -g -O2  -L../lib -o test-emit  Emit.o CuTest.o -lsyck 
make[2]: Nothing to be done for `all-am'.


make install
Making install in lib
test -z ""/usr/local/lib"" || mkdir -p -- ""/usr/local/lib""
 /sw/bin/ginstall -c -m 644 'libsyck.a' '/usr/local/lib/libsyck.a'
 ranlib '/usr/local/lib/libsyck.a'
test -z ""/usr/local/include"" || mkdir -p -- ""/usr/local/include""
 /sw/bin/ginstall -c -m 644 'syck.h' '/usr/local/include/syck.h'
 /sw/bin/ginstall -c -m 644 'syck_st.h' '/usr/local/include/syck_st.h'
Making install in tests
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.

}}}"	anonymous
Active Tickets	61	Raise ValueError on bad time stamps	pysyck			defect	normal	xi	new	2007-09-17T17:11:40-04:00	2007-09-19T12:51:24-04:00	"Currently if a timestamp is badly formatted, syck raises:
{{{
#!python
Traceback (most recent call last):
  File ""<pyshell#2>"", line 1, in <module>
    yaml = syck.load(open(""/var/spool/articles/20070917/9a45fab335a148a5999d8d000a3c23fe/article.yaml"").read())
  File ""/usr/local/lib/python2.5/site-packages/syck/loaders.py"", line 408, in load
    return loader.load()
  File ""/usr/local/lib/python2.5/site-packages/syck/loaders.py"", line 50, in load
    return self._convert(node, {})
  File ""/usr/local/lib/python2.5/site-packages/syck/loaders.py"", line 67, in _convert
    node_to_object)
  File ""/usr/local/lib/python2.5/site-packages/syck/loaders.py"", line 84, in _convert
    object = self.construct(node)
  File ""/usr/local/lib/python2.5/site-packages/syck/loaders.py"", line 174, in construct
    return constructor(node)
  File ""/usr/local/lib/python2.5/site-packages/syck/loaders.py"", line 242, in construct_timestamp
    values = match.groupdict()
AttributeError: 'NoneType' object has no attribute 'groupdict'
}}}
which is cryptic.

`construct_timestamp` should check the if the value was matched:
{{{
#!python
    def construct_timestamp(self, node):
        match = self.timestamp_expr.match(node.value)

        if not match:
            raise ValueError, ""bad time stamp: %s"" % node.value

}}}
"	miki@…
Active Tickets	75	libyaml trunk (rev 266) don't compile	libyaml			defect	normal	xi	new	2008-01-17T15:26:06-05:00	2008-01-17T15:28:08-05:00	"{{{mtebeka@bugs:libyaml - 12:13 $ ./bootstrap 
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force 
/usr/share/aclocal/imlib.m4:9: warning: underquoted definition of AM_PATH_IMLIB
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
/usr/share/aclocal/imlib.m4:167: warning: underquoted definition of AM_PATH_GDK_IMLIB
/usr/share/aclocal/gdk-pixbuf.m4:12: warning: underquoted definition of AM_PATH_GDK_PIXBUF
/usr/share/aclocal/audiofile.m4:12: warning: underquoted definition of AM_PATH_AUDIOFILE
/usr/share/aclocal/aalib.m4:12: warning: underquoted definition of AM_PATH_AALIB
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
Putting files in AC_CONFIG_AUX_DIR, `config'.
/home/mtebeka/src/libyaml/config
/usr/share/aclocal/imlib.m4:9: warning: underquoted definition of AM_PATH_IMLIB
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
/usr/share/aclocal/imlib.m4:167: warning: underquoted definition of AM_PATH_GDK_IMLIB
/usr/share/aclocal/gdk-pixbuf.m4:12: warning: underquoted definition of AM_PATH_GDK_PIXBUF
/usr/share/aclocal/audiofile.m4:12: warning: underquoted definition of AM_PATH_AUDIOFILE
/usr/share/aclocal/aalib.m4:12: warning: underquoted definition of AM_PATH_AALIB
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac: installing `config/install-sh'
configure.ac: installing `config/missing'
src/Makefile.am: installing `config/depcomp'
autoreconf: Leaving directory `.'
mtebeka@bugs:libyaml - 12:14 $ ./configure && make
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ld used by gcc... /usr/i486-slackware-linux/bin/ld
checking if the linker (/usr/i486-slackware-linux/bin/ld) is GNU ld... yes
checking for /usr/i486-slackware-linux/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/i486-slackware-linux/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag ""CXX"" to libtool
checking for ld used by g++... /usr/i486-slackware-linux/bin/ld
checking if the linker (/usr/i486-slackware-linux/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/i486-slackware-linux/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/i486-slackware-linux/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag ""F77"" to libtool
checking for doxygen... true
checking for ANSI C header files... (cached) yes
checking for stdlib.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
configure: creating ./config.status
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating tests/Makefile
config.status: creating config.h
config.status: executing depfiles commands
make  all-recursive
make[1]: Entering directory `/home/mtebeka/src/libyaml'
Making all in include
/home/mtebeka/src/libyaml/include
make[2]: Entering directory `/home/mtebeka/src/libyaml/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/mtebeka/src/libyaml/include'
Making all in src
/home/mtebeka/src/libyaml/src
make[2]: Entering directory `/home/mtebeka/src/libyaml/src'
if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I..  -I../include   -march=i586 -mtune=i686 -MT api.lo -MD -MP -MF "".deps/api.Tpo"" -c -o api.lo api.c; \
        then mv -f "".deps/api.Tpo"" "".deps/api.Plo""; else rm -f "".deps/api.Tpo""; exit 1; fi
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -march=i586 -mtune=i686 -MT api.lo -MD -MP -MF .deps/api.Tpo -c api.c  -fPIC -DPIC -o .libs/api.o
In file included from yaml_private.h:6,
                 from api.c:2:
../include/yaml.h:407: error: expected ',' or '}' before 'YAML_BLOCK_SEQUENCE_STYLE'
../include/yaml.h:1263: error: expected ',' or '}' before '.' token
../include/yaml.h:1514: error: expected specifier-qualifier-list before 'yaml_node_t'
../include/yaml.h:1685: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
api.c:341: error: conflicting types for 'yaml_parser_get_error'
../include/yaml.h:2385: error: previous declaration of 'yaml_parser_get_error' was here
api.c:521: error: conflicting types for 'yaml_emitter_get_error'
../include/yaml.h:2695: error: previous declaration of 'yaml_emitter_get_error' was here
api.c:803: warning: conflicting types for 'yaml_token_destroy'
api.c:317: warning: previous implicit declaration of 'yaml_token_destroy' was here
api.c: In function 'yaml_event_duplicate':
api.c:991: error: 'struct <anonymous>' has no member named 'is_plain_implicit'
api.c:992: error: 'const struct <anonymous>' has no member named 'is_plain_implicit'
api.c:993: error: 'struct <anonymous>' has no member named 'is_quoted_implicit'
api.c:994: error: 'const struct <anonymous>' has no member named 'is_quoted_implicit'
api.c:1007: error: 'struct <anonymous>' has no member named 'is_implicit'
api.c:1008: error: 'const struct <anonymous>' has no member named 'is_implicit'
api.c:1022: error: 'struct <anonymous>' has no member named 'is_implicit'
api.c:1023: error: 'const struct <anonymous>' has no member named 'is_implicit'
api.c: At top level:
api.c:1082: error: conflicting types for 'yaml_event_create_document_start'
../include/yaml.h:1003: error: previous declaration of 'yaml_event_create_document_start' was here
api.c:1191: error: conflicting types for 'yaml_event_create_scalar'
../include/yaml.h:1105: error: previous declaration of 'yaml_event_create_scalar' was here
api.c: In function 'yaml_event_create_scalar':
api.c:1228: error: 'struct <anonymous>' has no member named 'is_plain_implicit'
api.c:1228: error: 'struct <anonymous>' has no member named 'is_quoted_implicit'
api.c: In function 'yaml_event_create_sequence_start':
api.c:1272: error: 'struct <anonymous>' has no member named 'is_implicit'
api.c: In function 'yaml_event_create_mapping_start':
api.c:1331: error: 'struct <anonymous>' has no member named 'is_implicit'
api.c: At top level:
api.c:1365: warning: conflicting types for 'yaml_event_destroy'
api.c:499: warning: previous implicit declaration of 'yaml_event_destroy' was here
make[2]: *** [api.lo] Error 1
make[2]: Leaving directory `/home/mtebeka/src/libyaml/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mtebeka/src/libyaml'
make: *** [all] Error 2
mtebeka@bugs:libyaml - 12:14 $ svn info
Path: .
URL: http://svn.pyyaml.org/libyaml/trunk
Repository Root: http://svn.pyyaml.org
Repository UUID: 18f92427-320e-0410-9341-c67f048884a3
Revision: 266
Node Kind: directory
Schedule: normal
Last Changed Author: xi
Last Changed Rev: 266
Last Changed Date: 2008-01-03 19:33:04 -0800 (Thu, 03 Jan 2008)

}}}

gcc 4.1.2"	miki@…
Active Tickets	83	yaml_parser_load poorly handles end of stream.	libyaml			defect	normal	xi	new	2008-06-11T22:14:03-04:00	2008-06-11T22:14:03-04:00	"Calling yaml_parser_load after the last document in a file (should return a document with ""no root node"") returns a document with a nodes.start => uninitialized memory."	anonymous
Active Tickets	96	Added note about UnicodeError instead of the tuple of multiple classes. Also, bumping this ;-)	pysyck			defect	normal	xi	new	2008-10-23T11:53:40-04:00	2009-08-02T11:14:27-04:00	"{{{
>>> import syck
>>> syck.dump({'blah' : '\xea\xd3'})
Traceback (most recent call last):
  File ""C:\workspace\Digsby\syck_test.py"", line 2, in <module>
    syck.dump({'blah' : '\xea\xd3'})
  File ""C:\workspace\dpython\lib\site-packages\syck\dumpers.py"", line 295, in dump
    dumper.dump(object)
  File ""C:\workspace\dpython\lib\site-packages\syck\dumpers.py"", line 23, in dump
    self.emit(self._convert(object, {}))
  File ""C:\workspace\dpython\lib\site-packages\syck\dumpers.py"", line 40, in _convert
    self._convert(value, object_to_node)
  File ""C:\workspace\dpython\lib\site-packages\syck\dumpers.py"", line 28, in _convert
    node = self.represent(object)
  File ""C:\workspace\dpython\lib\site-packages\syck\dumpers.py"", line 97, in represent
    return representer(object)
  File ""C:\workspace\dpython\lib\site-packages\syck\dumpers.py"", line 112, in represent_str
    return _syck.Scalar(object.encode('ascii'), tag=""tag:yaml.org,2002:str"")
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
}}}

This can be fixed by changing line 115 of [http://pyyaml.org/browser/pysyck/trunk/lib/syck/dumpers.py dumpers.py] from 
{{{
        except UnicodeDecodeError:
}}}

to 
{{{
        except (UnicodeDecodeError, UnicodeEncodeError):
}}}

I left the UnicodeDecodeError in the except clause, but I don't think catching it is necessary unless _syck.Scalar(...) can raise a UnicodeDecodeError (I wasn't certain of this, nor am I sure how to find out).

Feel free to contact me for more info."	mike@…
Active Tickets	101	YAMLObject interacts poorly with __slots__	pyyaml			defect	normal	xi	new	2008-11-09T22:20:00-05:00	2008-11-10T09:44:47-05:00	"If I try to define a custom {{{__slots__}}} for a subclass of {{{YAMLObject}}} I get errors during serialization because the code tries to use {{{instance.__dict__.update}}}, but {{{__dict__}}} doesn't exist on objects with slots.

{{{
  File ""/usr/lib/python2.4/site-packages/yaml/__init__.py"", line 177, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
  File ""/usr/lib/python2.4/site-packages/yaml/__init__.py"", line 167, in dump_all
    dumper.represent(data)
  File ""/usr/lib/python2.4/site-packages/yaml/representer.py"", line 33, in represent
    node = self.represent_data(data)
  File ""/usr/lib/python2.4/site-packages/yaml/representer.py"", line 62, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File ""/home/piman/code/layer/layer/parse.py"", line 84, in __to_yaml
    return dumper.represent_yaml_object(
  File ""/usr/lib/python2.4/site-packages/yaml/representer.py"", line 248, in represent_yaml_object
    state = data.__dict__.copy()
AttributeError: 'NPoint' object has no attribute '__dict__'
}}}

Attached is a patch that makes the constructor use {{{setattr}}} and the representer use {{{__slots__}}} if {{{__dict__}}} is not available. I did not write unit tests, as I couldn't figure out how to run them, but it makes the unit tests for my own project (which uses {{{__slots__}}} for some objects and {{{__dict__}}} for others) pass."	Joe Wreschnig
Active Tickets	104	support for pushing data to the parser	pyyaml			defect	normal	xi	new	2008-11-13T12:46:23-05:00	2008-11-13T12:46:23-05:00	"It would be great if there was a small extension to the libyaml api.  Basically, I want to feed data to a yaml parser incrementally so i can implement a non-blocking single-threaded server.  The ideal would be if i could write (effectively):

   void handle_data_available (yaml_parser_t *parser,
                               size_t         len,
                               const uint8_t *data)
   {
      if (!yaml_parser_push_data (parser, len, data))
        handle_error ();
      while ((parse_rv=yaml_parser_load (parser, &document)) > 0)
        {
          handle_document ();
          yaml_document_free (&document);
        }
      if (parse_rv == 0)
        handle_parse_error ();
      else if (parse_rv == -1)
        { /* need to push more data: nothing to do */ }
    }

In general, most of the current API would take on a third possible return-value, -1, if there is no input stream and there is not enough data to continue.

But of course, there are numerous other implementation possibilities.  If this design seems ok i can probably contribute a patch."	daveb@…
Active Tickets	109	PySyck for Python 2.6 or Python 3.0	pysyck			task	normal	xi	new	2008-12-13T08:21:20-05:00	2009-03-16T18:17:13-04:00	"Is PySyck being abandon already? Is there any plan to build windows binary for Python 2.6 and Python 3.0?

I am still using PySyck now and I found it works well and much faster compare to Pyyaml."	sgwong513@…
Active Tickets	111	Questionable use of assert in tests	libyaml			defect	normal	xi	new	2008-12-22T23:15:55-05:00	1969-12-31T19:00:00-05:00	"I saw this line in run-loader.c

 assert(yaml_parser_initialize(&parser));

If NDEBUG is defined, then yaml_parser_initialize() will never run at all.
Is this what is intended?
"	harris.pc@…
Active Tickets	113	Changeset 313 dumps reduntant '...' (end of document)	pyyaml			defect	normal	xi	new	2009-01-06T05:32:55-05:00	2009-03-31T12:24:50-04:00	"When dumping a simple document (when there is no possibility of ambiguous parsing)
{{{
print '""%s""' % yaml.dump(""abc"")
}}}
a redundant ""end of document"" is emitted:
{{{
""abc
...
""
}}}"	py4fun@…
Active Tickets	119	Implicit resolver is not respected (the order is important)	pyyaml			defect	normal	xi	new	2009-03-31T12:51:17-04:00	2012-08-07T10:29:32-04:00	"The order in which the implicit resolvers are applied is important. The user defined implicit resolvers should be checked first.

In the test below '1.00' should parsed as string but instead it is parsed as float:
{{{
    def test1(self):
        pattern = re.compile(r""\d\.\d\d"")
        yaml.add_implicit_resolver(""tag:yaml.org,2002:str"", pattern, ""123"")
        t = yaml.load(""version: 1.00"")
        print t
        self.assertEquals('1.00', t['version'])
}}}
{{{
test1 (java.TestJava) ... {'version': 1.0}
FAIL

======================================================================
FAIL: test1 (java.TestJava)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""C:/projects/py-workspace/imp-resolver/tests\java.py"", line 15, in test1
    self.assertEquals('1.00', t['version'])
AssertionError: '1.00' != 1.0
}}}"	py4fun@…
Active Tickets	121	Support OrderedDict	pyyaml			task	normal	xi	new	2009-04-21T15:03:32-04:00	2009-04-21T15:03:32-04:00	"Currently, ''!!omap'' creates a list of pairs.  But in Py2.7 and Py3.1, it is possible to create an actual ordered dictionary.  [http://docs.python.org/dev/py3k/whatsnew/3.1.html#pep-372-ordered-dictionaries]

A version of ''OrderedDict'' is available that runs on earlier versions of Python as well.  [http://code.activestate.com/recipes/576693/]
"	anonymous
Active Tickets	124	setting allow_unicode	pyyaml			defect	normal	xi	new	2009-04-28T07:11:18-04:00	1969-12-31T19:00:00-05:00	"The theme of default escaping of Unicode chars on dumping has been discussed, e.g. here  [1]. I understand the point you decided for the more conservative approach - escape by defaut. Still. The escaped files are uneditable by humans - the fact that completely kills the purpose of yaml. Any software that uses pyuaml generates such unusable files. 

My proposal to minimize this pain: allow the allow_unicode flag to be settable also from ""outside"", e.g. environment variable, or any sort of global setting. Thus any software that uses pyyaml can be used without patching.

Please mention this unicode dumping problem also in the documentation. 


[1] - http://sourceforge.net/mailarchive/forum.php?thread_name=4973e7450902090705qbebe220md3a2df43f1623eac%40mail.gmail.com&forum_name=yaml-core"	viz.pub@…
Active Tickets	126	how to do INI-file-like substitution in pyYAML	pyyaml			task	normal	xi	new	2009-05-14T12:34:56-04:00	1969-12-31T19:00:00-05:00	"Here is a an '''INI''''''' file section using string substitution to define ''root folder'' and ''UNC path'':

{{{
[DEFAULT]
host         : sec-swds-dw.swpc.noaa.gov
satellite id : 13
root folder  : GOES%(satellite id)sSXI
UNC path     : \\%(host)s\%(root folder)s
}}}


I have been experimenting with !!python/object/apply:__builtin__.eval to define ''root folder'' and ''UNC path'', but so far, I have been unsuccessful.

How can this be done in pyYAML?

Thanks"	jim.vickroy@…
Active Tickets	139	please update for yaml-1.2 support	pyyaml			defect	normal	xi	new	2009-08-26T15:47:45-04:00	2012-03-29T11:36:07-04:00	"I was thinking about using pyyaml as a lax json parser, so users could enter either json or yaml or some mix of the two. Yaml 1.2 makes yaml a true superset of json so constructs such as {""one"":1,""two"":2} are valid (note the lack of a space after the ':')."	redbeard0531@…
Active Tickets	140	Plain equal sign (=) as node content results in an error	pyyaml			defect	normal	xi	new	2009-09-17T21:10:54-04:00	2009-09-17T21:10:54-04:00	"A plain equal sign (=) as node fails as invalid YAML.

== STEPS TO REPRODUCE ==

Load this document
{{{
=
}}}

== EXPECTED RESULTS ==

A plain equal sign used as anything other than a key should be the String type (tag:yaml.org,2002:str).

The above document should result in this canonical document:
{{{
%YAML 1.1
---
!!str ""=""
...
}}}

With this node structure:

{{{
ScalarNode(tag=u'tag:yaml.org,2002:str', value=u'=')
}}}

That is it should have been equivalent to this document:

{{{
""=""
}}}

== ACTUAL RESULTS ==

Attempts to treat equal sign as the [http://yaml.org/type/value.html Value Key] type (tag:yaml.org,2002:value) and throws this error:

{{{
The document is not valid YAML:
could not determine a constructor for the tag 'tag:yaml.org,2002:value'
  in """", line 1, column 1:
    =
    ^
}}}

== NOTES ==

Here's an example of equal sign correctly being treated as the Value Key type:

{{{
= : 1
}}}

Producing this canonical document and node:

{{{
%YAML 1.1
---
!!map {
    ? !!str ""=""
    : !!int ""1"",
}
...
}}}

{{{
MappingNode(tag=u'tag:yaml.org,2002:map', value=[(ScalarNode(tag=u'tag:yaml.org,2002:value', value=u'='),
 ScalarNode(tag=u'tag:yaml.org,2002:int', value=u'1'))])
}}}

The document in STEPS TO REPRODUCE is the simplest document that fails, but these documents also fail:

{{{
- =
}}}

{{{
a: =
}}}
"	pyyaml@…
Active Tickets	142	decimal type support in pyYAML	pyyaml			enhancement	normal	xi	new	2009-11-12T11:28:59-05:00	2009-11-12T11:28:59-05:00	"I would like to be able to faithfully round trip real numbers with YAML avoiding the
imprecision that happens in the conversions decimal text => binary float => decimal text.
Is it possible to override the default pyYAML conversion of reals to double and use the decimal type instead? I want to avoid decorating the YAML document with explicit types. 
"	anonymous
Active Tickets	143	implicit_resolver does not work with literal block scalars, here is the test	pyyaml			defect	normal	xi	new	2009-11-18T16:52:35-05:00	2009-11-18T16:52:35-05:00	"import yaml
import re

s  = """"""
good: foo
bad: |
     foo""""""

class Test(yaml.YAMLObject):
    yaml_tag = '!test'
    pattern = re.compile(r'foo')
    yaml.add_implicit_resolver('!test', pattern)

    def __init__(self, s):
        self.s = s
    def __repr__(self):
        return 'Test(%s)' % self.s

    @classmethod
    def from_yaml(cls, loader, node):
        value = loader.construct_scalar(node)
        return cls(value)

print yaml.load(s)
# emits>> {'bad': 'foo', 'good': Test(foo)}"	berlin_lev@…
Active Tickets	145	Memory leak in yaml_document_t?	libyaml			defect	normal	xi	new	2009-11-20T07:48:21-05:00	1969-12-31T19:00:00-05:00	"valgrind (v3.3.0) reports a memory after having called yaml_document_delete():

1,536 bytes in 1 blocks are definitely lost in loss record 1 of 1
   at 0x4C2560E: malloc (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
   by 0x4E2DF68: yaml_document_initialize (api.c:1058)
   by 0x4009F7: main (yaml-leak.c:11)

when running the attached, very minimal, program. All it does is yaml_parse_load() of any yaml input. (A single word will do.)
This is with libyaml 0.1.3.
"	pem@…
Active Tickets	148	relative imports required for inter-package imports	pyyaml			defect	normal	xi	new	2009-12-09T05:16:17-05:00	2009-12-09T05:16:17-05:00	"I ran into a case where the line
{{{
#!python
from parser import *
}}}
in '''loader.py''' referenced an external module.
Such imports really should be relative:
{{{
#!python
from .parser import *
}}}
This is especially important in view of [PEP328 http://www.python.org/dev/peps/pep-0328/] since absolute imports are being phased out.
"	anonymous
Active Tickets	149	Throws wrong ValueError exception on bad time stamps	pyyaml			defect	normal	xi	new	2009-12-10T05:04:48-05:00	2009-12-10T05:04:48-05:00	"If a timestamp is badly formatted construct_yaml_timestamp() throws an uncaught ValueError instead of yaml.YAMLError:

{{{
>>> yaml.safe_load(""2009-13-11"")
Traceback (most recent call last):
  File ""<pyshell#4>"", line 2, in <module>
    yaml.safe_load(""2009-13-11"")
  File ""C:\Python26\lib\site-packages\yaml\__init__.py"", line 75, in safe_load
    return load(stream, SafeLoader)
  File ""C:\Python26\lib\site-packages\yaml\__init__.py"", line 58, in load
    return loader.get_single_data()
  File ""C:\Python26\lib\site-packages\yaml\constructor.py"", line 44, in get_single_data
    return self.construct_document(node)
  File ""C:\Python26\lib\site-packages\yaml\constructor.py"", line 48, in construct_document
    data = self.construct_object(node)
  File ""C:\Python26\lib\site-packages\yaml\constructor.py"", line 93, in construct_object
    data = constructor(self, node)
  File ""C:\Python26\lib\site-packages\yaml\constructor.py"", line 318, in construct_yaml_timestamp
    return datetime.date(year, month, day)
ValueError: month must be in 1..12
}}}

Environment:

    * Python 2.6.4 on Windows XP
    * PyYAML-3.09-py2.5.exe 


I think the function should include something like this:

{{{
try:
    return datetime.date(year, month, day)
except ValueError:
    raise ConstructorError(None,None,""inappropriate date value"",node.start_mark)
}}}

Thank you."	f_d_c_-alquiler@…
Active Tickets	151	Patch to libyaml to handle concatenation according to yaml 1.2 spec	libyaml			enhancement	normal	xi	new	2009-12-23T17:36:14-05:00	2009-12-23T17:44:26-05:00	"This removes the requirement that ""..."" has to have a ""---"" after it. It also removes the need for directives to have ""---"" after them, which is not according to spec, however I think possibly the spec should be changed, not this program.

"	spitzak@…
Active Tickets	152	Patch to libyaml to handle anchor/alias according to libyaml 1.2 spec	libyaml			defect	normal	xi	new	2009-12-23T17:38:44-05:00	2009-12-23T17:44:54-05:00	"libyaml1.2 allows a lot more byte values in anchor/alias names, this alters the code to allow them.
"	spitzak@…
Active Tickets	154	libyaml parser does not recognise custom tags	pyyaml			defect	normal	xi	new	2010-01-28T20:15:09-05:00	2010-10-11T02:32:36-04:00	"{{{
/usr/bin/python /Users/hardkrash/Desktop/libyaml_custom_class_broken.py 
Monster(name='Cave spider', hp=[2, 6], ac=16, attacks=['BITE', 'HURT'])




Traceback (most recent call last):
  File ""/Users/hardkrash/Desktop/libyaml_custom_class_broken.py"", line 32, in <module>
    """""", Loader=yaml.CLoader)
  File ""/Library/Python/2.5/site-packages/PyYAML-3.09-py2.5-macosx-10.5-i386.egg/yaml/__init__.py"", line 58, in load
  File ""/Library/Python/2.5/site-packages/PyYAML-3.09-py2.5-macosx-10.5-i386.egg/yaml/constructor.py"", line 44, in get_single_data
  File ""/Library/Python/2.5/site-packages/PyYAML-3.09-py2.5-macosx-10.5-i386.egg/yaml/constructor.py"", line 48, in construct_document
  File ""/Library/Python/2.5/site-packages/PyYAML-3.09-py2.5-macosx-10.5-i386.egg/yaml/constructor.py"", line 93, in construct_object
  File ""/Library/Python/2.5/site-packages/PyYAML-3.09-py2.5-macosx-10.5-i386.egg/yaml/constructor.py"", line 419, in construct_undefined
yaml.constructor.ConstructorError: could not determine a constructor for the tag '!Monster'
  in ""<byte string>"", line 2, column 5
}}}"	smichalske@…
Active Tickets	159	Yaml failed to restore loops in objects when __setstate__ is defined	pyyaml			defect	normal	xi	new	2010-04-01T16:15:26-04:00	2011-02-01T18:52:31-05:00	"Below code works with cPickle but failed with yaml:

{{{
import yaml, cPickle

class A(yaml.YAMLObject) :
    def __setstate__(self, state) :
        print ""A""
        self.__dict__.update(state)

class B(yaml.YAMLObject) :
    def __setstate__(self, state) :
        print ""B""
        self.__dict__.update(state)

class C(yaml.YAMLObject) :
    def __setstate__(self, state) :
        print ""C""
        self.__dict__.update(state)

import cPickle
        
a = A()
a.b = B()
a.b.c = C()
a.b.c.b = a.b
cPickle.loads(cPickle.dumps(a))
yaml.load(yaml.dump(a))
}}}

Here is a patch with possible solution for this problem:

{{{
Index: constructor.py
===================================================================
--- constructor.py	(revision 1736)
+++ constructor.py	(working copy)
@@ -64,8 +64,11 @@
         if node in self.constructed_objects:
             return self.constructed_objects[node]
         if node in self.recursive_objects:
-            raise ConstructorError(None, None,
+            obj = self.recursive_objects[node]
+            if obj is None :
+                raise ConstructorError(None, None,
                     ""found unconstructable recursive node"", node.start_mark)
+            return obj
         self.recursive_objects[node] = None
         constructor = None
         tag_suffix = None
@@ -97,6 +100,7 @@
             generator = data
             data = generator.next()
             if self.deep_construct:
+                self.recursive_objects[node] = data
                 for dummy in generator:
                     pass
             else:
}}}"	viktor.x.voroshylo@…
Active Tickets	161	Recipie for using collections.OrderedDict as the primary pyyaml mapping type	pyyaml			enhancement	normal	xi	new	2010-06-10T21:50:04-04:00	1969-12-31T19:00:00-05:00	"I know ticket #29 was closed as won't fix, but the Python3 OrderedDict is a standard library type, and for the project I'm working on (my first use of yaml) I wouldn't be able to use yaml unless mapping key order is maintained across load/dump.

To save other people the trouble of figuring out how to do this, the attached recipe seems to work to make pyyaml use collections.OrderedDict as the primary object type for mappings, instead of the regular dict.

It involves one bit of monkey patching and includes modified versions of a couple methods from version 3.09 of pyyaml.  It modifies Constructor and Representer, but could easily be changed to use SafeConstrutor and SafeRepresenter if that's what the application needs.

I think it would lovely if collections.OrderedDict was used normally, or at least optionally."	rdmurray@…
Active Tickets	162	Error encountered during PyYAML install after Python 26 successfully found in registry	pyyaml			defect	normal	xi	new	2010-07-24T16:13:00-04:00	2013-06-11T04:05:01-04:00	"On windows xp when I run the PyYAML install download from the NLTK site, it successfully finds Python 2.6. I hit the next button and I get the classic windows ""encountered a problem, needs to close, sorry"" error. 

Error signature:
AppName: pyyaml-3.09.win32-py2.6[1].exe	 AppVer: 0.0.0.0	 ModName: pyyaml-3.09.win32-py2.6[1].exe
ModVer: 0.0.0.0	 Offset: 000086dc"	anonymous
Active Tickets	164	Bad preprocessor macros for VS2008 projects	libyaml			defect	normal	xi	new	2010-08-18T14:20:51-04:00	2010-08-18T14:36:17-04:00	"Some projects in the VS2008 solution (''yaml'' and ''yamldll'', for instance) are missing important macros:

 * `WIN32` and `_DEBUG` in the debug version
 * `WIN32` and `NDEBUG` in the release version

As a result they are not exporting symbols correctly (`yaml.h` tests for the `WIN32` macro) and are generating debug information when they shouldn't."	Romulo A. Ceccon
Active Tickets	178	Problem with parsing ':'	pyyaml			defect	normal	xi	new	2010-11-09T14:08:23-05:00	2010-11-09T14:08:23-05:00	"Hello,

The simple string ':' should be parsed, as far as I understand YAML specification, as { '': '' }. pyyaml simply gives up (ipython trace, with the debian version 3.09-5 of python-yaml, Python 2.6.6, IPython 0.10):

In [14]: yaml.load(':')

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (5, 0))

---------------------------------------------------------------------------
ParserError                               Traceback (most recent call last)

/tmp/<ipython console> in <module>()

/usr/lib/python2.6/dist-packages/yaml/__init__.pyc in load(stream, Loader)
     56     """"""
     57     loader = Loader(stream)
---> 58     return loader.get_single_data()
     59 
     60 def load_all(stream, Loader=Loader):

/usr/lib/python2.6/dist-packages/yaml/constructor.pyc in get_single_data(self)
     40     def get_single_data(self):
     41         # Ensure that the stream contains a single document and construct it.

---> 42         node = self.get_single_node()
     43         if node is not None:
     44             return self.construct_document(node)

/usr/lib/python2.6/dist-packages/yaml/composer.pyc in get_single_node(self)
     34         document = None
     35         if not self.check_event(StreamEndEvent):
---> 36             document = self.compose_document()
     37 
     38         # Ensure that the stream contains no more documents.


/usr/lib/python2.6/dist-packages/yaml/composer.pyc in compose_document(self)
     53 
     54         # Compose the root node.

---> 55         node = self.compose_node(None, None)
     56 
     57         # Drop the DOCUMENT-END event.


/usr/lib/python2.6/dist-packages/yaml/composer.pyc in compose_node(self, parent, index)
     82             node = self.compose_sequence_node(anchor)
     83         elif self.check_event(MappingStartEvent):
---> 84             node = self.compose_mapping_node(anchor)
     85         self.ascend_resolver()
     86         return node

/usr/lib/python2.6/dist-packages/yaml/composer.pyc in compose_mapping_node(self, anchor)
    125         if anchor is not None:
    126             self.anchors[anchor] = node
--> 127         while not self.check_event(MappingEndEvent):
    128             #key_event = self.peek_event()

    129             item_key = self.compose_node(node, None)

/usr/lib/python2.6/dist-packages/yaml/parser.pyc in check_event(self, *choices)
     91         if self.current_event is None:
     92             if self.state:
---> 93                 self.current_event = self.state()
     94         if self.current_event is not None:
     95             if not choices:

/usr/lib/python2.6/dist-packages/yaml/parser.pyc in parse_block_mapping_first_key(self)
    418         token = self.get_token()
    419         self.marks.append(token.start_mark)
--> 420         return self.parse_block_mapping_key()
    421 
    422     def parse_block_mapping_key(self):

/usr/lib/python2.6/dist-packages/yaml/parser.pyc in parse_block_mapping_key(self)
    432             token = self.peek_token()
    433             raise ParserError(""while parsing a block mapping"", self.marks[-1],
--> 434                     ""expected <block end>, but found %r"" % token.id, token.start_mark)
    435         token = self.get_token()
    436         event = MappingEndEvent(token.start_mark, token.end_mark)

ParserError: while parsing a block mapping
expected <block end>, but found ':'
  in ""<string>"", line 1, column 1:
    :
    ^

Best regards

Samuel Hym"	Samuel.Hym@…
Active Tickets	180	"""on"" or ""off"" as node name becomes ""True"" or ""False"""	pyyaml			defect	normal	xi	new	2010-12-07T07:25:26-05:00	2010-12-07T07:25:26-05:00	"When loading a yaml document with node names ""on"" or ""off"" (or similar) the node names are stored as ""True"" or ""False"" in the dictionary:

{{{
>>> y = """"""
---
value: 3.14
on: 1
off: 2
""""""
>>> yaml.safe_load(y)
{False: 2, True: 1, 'value': 3.1400000000000001}
>>> yaml.load(y)
{False: 2, True: 1, 'value': 3.1400000000000001}
}}}

IMHO this rewriting makes sense for the value, but not for the node name.

Stephan"	s.p.helma@…
Active Tickets	185	cyaml doesn't work on Mac OS X.6.6 with Python 2.6 or 3.2	pyyaml			defect	normal	xi	new	2011-03-08T03:46:08-05:00	2011-03-08T03:46:08-05:00	"1) in _yaml.h #include <yaml.h> doesn't find ""/usr/local/include/yaml.h""

2) with #include ""/usr/local/include/yaml.h"" it seems to work OK but whith the following warning:

gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g build/temp.macosx-10.6-intel-3.2/ext/_yaml.o -lyaml -o build/lib.macosx-10.6-intel-3.2/_yaml.so
ld: warning: in /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libyaml.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

3) then python3 setup.py --with-libyaml install seems also to work OK but when I try to use it I pinpoint the following error:

>>> from yaml import CLoader
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
ImportError: cannot import name CLoader

to a more explicite one:

>>> import yaml.cyaml
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/yaml/cyaml.py"", line 5, in <module>
    from _yaml import CParser, CEmitter
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/_yaml.so, 2): Symbol not found: _PyCObject_FromVoidPtr
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/_yaml.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/_yaml.so

Thank you."	anonymous
Active Tickets	187	"Failed  when run ""python setup install"""	pyyaml			defect	normal	xi	new	2011-03-28T04:53:53-04:00	2011-05-22T21:39:07-04:00	"error msg:
{{{
...

ext/_yaml.c: In function ‘__Pyx_InitCachedBuiltins’:
ext/_yaml.c:18667: error: ‘__pyx_builtin_MemoryError’ undeclared (first use in this function)
ext/_yaml.c:18667: error: ‘__pyx_b’ undeclared (first use in this function)
ext/_yaml.c:18668: error: ‘__pyx_builtin_AttributeError’ undeclared (first use in this function)
ext/_yaml.c:18669: error: ‘__pyx_builtin_TypeError’ undeclared (first use in this function)
ext/_yaml.c:18670: error: ‘__pyx_builtin_ValueError’ undeclared (first use in this function)

...
}}}

and my GCC version: gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) 
"	liuhui1020@…
Active Tickets	190	PyYAML always uses pickle protocol 2 although Python 2.6 only supports 0 and 1	pyyaml			defect	normal	xi	new	2011-05-03T08:55:16-04:00	2011-05-22T21:35:13-04:00	"I get this when I save my data, which has no problem with pickle.dump, but bails with yaml. I haven't yet managed to dissect our data structure and find the actual problematic instance.

From the stack-trace (below), it seems as if __reduce_ex__ is called with proto=2, but py 2.6. supports only 0 and 1, and the assert in copy_reg doesn't trigger.

{{{
Traceback (most recent call last):
  File ""E:\Orsync\Apps\Orsync\src\orsync\model\tests\storage_test.py"", line 55, in testWithSubModel
    uber2 = self._copyByDumpLoad(uber)
  File ""E:\Orsync\Apps\Orsync\src\orsync\model\tests\storage_test.py"", line 14, in _copyByDumpLoad
    data = self.storage.dumps(object)
  File ""E:\Orsync\Apps\Orsync\src\orsync\model\storage.py"", line 217, in dumps
    return self.yaml.dump(stored_model)
  File ""E:\Orsync\_work\3rd\python\yaml\__init__.py"", line 175, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
  File ""E:\Orsync\_work\3rd\python\yaml\__init__.py"", line 165, in dump_all
    dumper.represent(data)
  File ""E:\Orsync\_work\3rd\python\yaml\representer.py"", line 33, in represent
    node = self.represent_data(data)
  File ""E:\Orsync\_work\3rd\python\yaml\representer.py"", line 62, in represent_data
    node = self.yaml_representers[data_types[0]](self, data)
  File ""E:\Orsync\_work\3rd\python\yaml\representer.py"", line 228, in represent_dict
    return self.represent_mapping(u'tag:yaml.org,2002:map', data)
  File ""E:\Orsync\_work\3rd\python\yaml\representer.py"", line 128, in represent_mapping
    node_value = self.represent_data(item_value)
  File ""E:\Orsync\_work\3rd\python\yaml\representer.py"", line 66, in represent_data
    node = self.yaml_multi_representers[data_type](self, data)
  File ""E:\Orsync\_work\3rd\python\yaml\representer.py"", line 439, in represent_object
    u'tag:yaml.org,2002:python/object:'+function_name, state)
  File ""E:\Orsync\_work\3rd\python\yaml\representer.py"", line 128, in represent_mapping
    node_value = self.represent_data(item_value)
  File ""E:\Orsync\_work\3rd\python\yaml\representer.py"", line 66, in represent_data
    node = self.yaml_multi_representers[data_type](self, data)
  File ""E:\Orsync\_work\3rd\python\yaml\representer.py"", line 413, in represent_object
    reduce = data.__reduce_ex__(2)
  File ""c:\_work\_unzip\python\python-2.6.2c1-win32.7z\python-2.6.2c1-win32\lib\copy_reg.py"", line 70, in _reduce_ex
    raise TypeError, ""can't pickle %s objects"" % base.__name__
TypeError: can't pickle int objects
}}}"	Marcus Lindblom Sonestedt <macke@…>
Active Tickets	191	CSafeLoader and CSafeDumper are missing a dispose method in 3.10 and trunk	pyyaml			defect	normal	xi	new	2011-06-23T11:35:27-04:00	2011-06-27T00:57:04-04:00	"I've attached reproducers. This was discovered in Ubuntu Oneiric, where 3.10 is the stock {{{python-yaml}}} package version.

{{{

Traceback (most recent call last):
  File ""yaml_test.py"", line 5, in <module>
    yaml.dump(""Foobar"", fd, Dumper=CSafeDumper)
  File ""/home/jesstess/pyyaml-trunk/lib/yaml/__init__.py"", line 204, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
  File ""/home/jesstess/pyyaml-trunk/lib/yaml/__init__.py"", line 195, in dump_all
    dumper.dispose()
AttributeError: 'CSafeDumper' object has no attribute 'dispose'
}}}"	jesstess
Active Tickets	192	ignore_aliases breaks with numy arrays	pyyaml			defect	normal	xi	new	2011-07-05T18:17:10-04:00	1969-12-31T19:00:00-05:00	"With all numpy arrays except type double, yaml crashes with error below:

TypeError: data type not understood

steps to reproduce:
python -c ""import yaml; yaml.load(yaml.dump(arange(12, dtype = 'i')))""

steps to correct:
patch yaml/representer.py using attached file

It appears that None and tuple or handled in a separate line from all other types.  This can be avoided using the NoneType from types.

Is there some other reason that these two are handled out of line?

By changing the implementation, numpy arrays of all types can be dumped."	barronh@…
Active Tickets	193	PyYAML doesn't use __float__, etc.	pyyaml			enhancement	normal	xi	new	2011-07-11T17:38:04-04:00	2011-07-11T17:38:04-04:00	"I've noticed that PyYAML doesn't seem to respect the __float__, or other default type casters.  This makes setting up serialization of some types trickier than it needs to be.

IE:  I can convert a numpy array to nested lists easily using the tolist() method, but the values inside may still be one of the default bumpy types.... even though most of those types have a __float__ method to cast the value...

I could add a bunch of yaml handlers, but that would be sub-optimal."	craigyk@…
Active Tickets	194	A generic event initialize function for libyaml.	libyaml			enhancement	normal	xi	new	2011-07-12T12:27:53-04:00	1969-12-31T19:00:00-05:00	"I am attaching source code that I attempted to doctor up to libyaml formats and standards.

It is a copy function for yaml events.  I am finding this function very useful in my current project in which I am trying to read a yaml configuration file in C.

Thus, I thought I'd share it."	westonwberry@…
Active Tickets	195	explict non-specific tags	libyaml			defect	normal	xi	new	2011-07-28T11:53:11-04:00	2011-07-28T11:53:11-04:00	"libyaml is not resolving explicit non-specific tags correctly. For example, `! 12` should come out as a !!str, not an !!int. The explicit use of `!` is supposed to suppress implicit type resolution.
"	transfire@…
Active Tickets	197	Non-BMP unicode characters are dumped using surrogate code units if python was not configured with UCS4	pyyaml			defect	normal	xi	new	2011-08-05T10:53:16-04:00	2011-08-06T18:48:17-04:00	"If python is built with UCS2 (the default, for example, on OS X), you get:

>>> yaml.dump(u'\U0001D10C')
""\uD834\uDD0C""

The output should instead be ""\U0001D10C"", since the surrogate code units are not valid unicode characters."	travis.mcleskey@…
Active Tickets	199	"""\U""-style escape sequences cannot be loaded if python was not compiled with UCS4"	pyyaml			defect	normal	xi	new	2011-08-06T18:52:26-04:00	2011-08-06T18:52:26-04:00	"If python was built with UCS2 (the default, for example, on OS X), you get:


{{{
>>> yaml.load('""\U0001D10C""')
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/Library/Python/2.7/site-packages/yaml/__init__.py"", line 71, in load
    return loader.get_single_data()
  File ""/Library/Python/2.7/site-packages/yaml/constructor.py"", line 37, in get_single_data
    node = self.get_single_node()
  File ""/Library/Python/2.7/site-packages/yaml/composer.py"", line 35, in get_single_node
    if not self.check_event(StreamEndEvent):
  File ""/Library/Python/2.7/site-packages/yaml/parser.py"", line 98, in check_event
    self.current_event = self.state()
  File ""/Library/Python/2.7/site-packages/yaml/parser.py"", line 143, in parse_implicit_document_start
    StreamEndToken):
  File ""/Library/Python/2.7/site-packages/yaml/scanner.py"", line 116, in check_token
    self.fetch_more_tokens()
  File ""/Library/Python/2.7/site-packages/yaml/scanner.py"", line 248, in fetch_more_tokens
    return self.fetch_double()
  File ""/Library/Python/2.7/site-packages/yaml/scanner.py"", line 656, in fetch_double
    self.fetch_flow_scalar(style='""')
  File ""/Library/Python/2.7/site-packages/yaml/scanner.py"", line 667, in fetch_flow_scalar
    self.tokens.append(self.scan_flow_scalar(style))
  File ""/Library/Python/2.7/site-packages/yaml/scanner.py"", line 1156, in scan_flow_scalar
    chunks.extend(self.scan_flow_scalar_non_spaces(double, start_mark))
  File ""/Library/Python/2.7/site-packages/yaml/scanner.py"", line 1223, in scan_flow_scalar_non_spaces
    chunks.append(unichr(code))
ValueError: unichr() arg not in range(0x10000) (narrow Python build)
>
}}}
"	anonymous
Active Tickets	200	should produce cleaner error message when processing documents containing tabs	libyaml			enhancement	normal	xi	new	2011-08-10T02:20:11-04:00	2011-08-10T02:24:34-04:00	"I am facing a problem while trying to execute a program taking YAML documents as input, and get the following error message (This error occurs when libyaml finds unparsable yaml files, in this case a Tab character used for indenting.):

The error is thrown in the 7th line as:
Error: YAML syntax error - found character that cannot start any token while scanning for the next token, at line 7

Instead, I need some message like this:
Error: YAML syntax error - found a tab character where intendation spaces are expected while scanning for the next token, at line 7

Tab errors, as far as I know, is very common in YAML documents, it will help a lot.
In fact, the problem is very easy to fix, just add a few lines in scanner.c, line 1041:

{{{
/* Is it a tab? */
    
if (CHECK(parser->buffer, '\t'))
    return yaml_parser_set_scanner_error(parser,
    	    ""while scanning for the next token"", parser->mark,
	    ""found a tab character where intendation spaces are expected"");
}}}
"	liu.long@…
Active Tickets	201	PyYAML cannot load set with an object of a class with custom __hash__	pyyaml			defect	normal	xi	new	2011-09-18T18:40:16-04:00	1969-12-31T19:00:00-05:00	"I have a class of immutable objects with a hash that depends on creation-time arguments:
{{{
class Example(object):
    def __init__(self, name):
        self._name = name
    def __eq__(self, other):
        return isinstance(other, Example) and other._name == self._name
    def __hash__(self):
        return hash(self._name)
    def __repr__(self):
        return ""Example(name={!r})"".format(self._name)
}}}
Unlike pickle, PyYAML is unable to load a set containing such an object:
{{{
>>> import pickle
>>> import yaml
>>> ex = Example('test')
>>> source = {ex}
>>> pickle.loads(pickle.dumps(ex))
Example(name='test')
>>> pickle.loads(pickle.dumps(source))
{Example(name='test')}
>>> yaml.load(yaml.dump(ex))
Example(name='test')
>>> yaml.load(yaml.dump(source))
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/usr/lib64/python3.2/site-packages/yaml/__init__.py"", line 72, in load
    return loader.get_single_data()
  File ""/usr/lib64/python3.2/site-packages/yaml/constructor.py"", line 37, in get_single_data
    return self.construct_document(node)
  File ""/usr/lib64/python3.2/site-packages/yaml/constructor.py"", line 46, in construct_document
    for dummy in generator:
  File ""/usr/lib64/python3.2/site-packages/yaml/constructor.py"", line 384, in construct_yaml_set
    value = self.construct_mapping(node)
  File ""/usr/lib64/python3.2/site-packages/yaml/constructor.py"", line 204, in construct_mapping
    return super().construct_mapping(node, deep=deep)
  File ""/usr/lib64/python3.2/site-packages/yaml/constructor.py"", line 130, in construct_mapping
    mapping[key] = value
  File ""<stdin>"", line 7, in __hash__
AttributeError: 'Example' object has no attribute '_name'
}}}
The reason is probably that PyYAML tries to add the object to a set before restoring its attributes. It is easy to work around using {{{__getnewargs__}}} but unexpected as (a) pickle handles the situation correctly and (b) no documentation, either the pickle one or the pyyaml one, mentions the need to restore everything used for hashing with {{{__getnewargs__}}}.
So PyYAML probably should either deal correctly with this case, or at least have it mentioned in the documentation."	anonymous
Active Tickets	202	cannot roundtrip offset-aware datetime instances	pyyaml			enhancement	normal	xi	new	2011-09-25T15:32:33-04:00	2012-12-28T17:02:31-05:00	"I'd expect that `yaml.load(yaml.dump(foo) == foo` for reasonable values of `foo`.

However, this isn't true for timezone-aware datetimes:
{{{
>>> import datetime
>>> from pytz import utc
>>> import yaml
>>> dt = datetime.datetime(2011, 9, 1, 10, 20, 30, 405060, tzinfo=utc)
>>> yaml.load(yaml.dump(dt)) == dt
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
TypeError: can't compare offset-naive and offset-aware datetimes
>>> yaml.load(yaml.dump(dt))
datetime.datetime(2011, 9, 1, 10, 20, 30, 405060)
}}}

PyYAML dumps the offset correctly, but when it loads the value, it returns a naive datetime in UTC, with the offset susbtracted.

Instead, I suggest using a simple tzinfo class, such as the following (from http://docs.python.org/library/datetime.html) to represent offsets:

{{{
from datetime import timedelta, tzinfo

class FixedOffset(tzinfo):
    """"""Fixed offset in minutes east from UTC.""""""

    def __init__(self, offset, name):
        self.__offset = timedelta(minutes=offset)
        self.__name = name

    def utcoffset(self, dt):
        return self.__offset

    def tzname(self, dt):
        return self.__name

    def dst(self, dt):
        return timedelta(0)
}}}

Note that it often makes sense to handle naive datetimes (such as user input) in local times. In such cases, round-tripping a timezone-aware datetime through PyYAML — for example, dumping/loading fixtures in Django — will result in data corruption.

See also #25 and [https://bitbucket.org/aaugustin/django/src/3209d08a4ab8/django/db/models/fields/__init__.py#cl-700 this solution to the same problem]."	aaugustin
Active Tickets	205	Anchor names and aliases can only contain numbers and ASCII letters, but 1.2 allows more	pyyaml			defect	normal	xi	new	2011-10-07T00:59:21-04:00	1969-12-31T19:00:00-05:00	"I understand the reason this limitation was put in. In earlier versions of the specifications, anchors and aliases could contain commas, which would cause problems with flow collections. However, 1.2 explicitly rules them out, so this limitation should be lifted.

I've tried to provide code that does that, with a test case."	peterkmurphy@…
Active Tickets	206	Need ability to reuse and expand on defined lists and mappings.	libyaml			enhancement	normal	xi	new	2011-10-12T12:52:04-04:00	2011-11-19T16:24:34-05:00	"Every yaml file I've created requires some form of data reuse. YAML should support list and mapping expansions using existing anchor and reference syntax.

{{{
default_items: &default
- item one
- item two
- item three
my_items: *default
- additional item
}}}
{{{
default_items: &default
  one: two
  foo: bar
my_items: *default
  one: override
}}}

Having this ability would be valuable, and appears clean and logical in terms of the existing syntax. Submitting for consideration."	philip@…
Active Tickets	207	improve unable to represent object error message	pyyaml			enhancement	normal	xi	new	2011-10-17T19:11:00-04:00	2011-10-17T19:11:00-04:00	see the following diff to give a little better information on what the object type is	terence@…
Active Tickets	208	Yaml doesn't parse ISO8601 datetimes if they do not include seconds.	pyyaml			defect	normal	xi	new	2011-10-25T00:00:52-04:00	2011-12-31T00:30:03-05:00	"When YAML sees a ISO8601 date, or a datetime that includes seconds, it returns the right Python objects. But if the datetime only goes out to minutes and doesn't include the seconds, a plain string is returned.

Here is an example from a python interactive session:

{{{
>>> yaml.__version__
'3.10
>>> yaml.load('2011-10-24')
datetime.date(2011, 10, 24)
>>> yaml.load('2011-10-24 12:00:00')
datetime.datetime(2011, 10, 24, 12, 0)
>>> yaml.load('2011-10-24 12:00')
'2011-10-24 12:00'
}}}
"	mythmon@…
Active Tickets	209	YAMLObject to work with any loader	pyyaml			enhancement	normal	xi	new	2011-10-26T16:35:21-04:00	2011-10-26T16:35:21-04:00	"I’m using `SafeLoader` with all my PyYAML load commands. However to be able to use custom `YAMLObject`s, I am required to set the custom object’s `yaml_loader` property to that loader as well to make it discoverable. This should work differently, so a single `YAMLObject` subtype is not bound to a single Loader type.

For example when loading using this line:

{{{
yaml.load( stream, Loader=yaml.SafeLoader )
}}}

I am required to define a YAMLObject like this:

{{{
class YamlTest ( YAMLObject ):
    yaml_tag = '!Test'
    yaml_loader = yaml.SafeLoader
}}}

The metaclass should store the constructor and representer references somewhere outside of the Loader and Dumper class objects so defined types work universally."	poke
Active Tickets	210	Impossible to copy the properties of one branch to another	pyyaml			enhancement	normal	xi	new	2011-11-04T15:11:44-04:00	1969-12-31T19:00:00-05:00	"How can I do something like this?

db_conn:
  mysql_1:          &mysql_1
    type: mysql

    host: localhost

    name: root

    pass: 54321

db:
  default:
    *mysql_1         // <- it must copy all fields from mysql_1

    pass: 12345      // <- and append this field


... and why can not I do this?

db:
  default:
    **db_conn.mysql_1

    pass: 12345
"	lishnih@…
Active Tickets	211	PyYAML in Python 3.2 Stackless 3.1b3 060516	pyyaml			defect	normal	xi	new	2011-11-15T13:35:26-05:00	2011-11-15T13:35:26-05:00	"Running on Windows 7 Pro Edition 64 bit
Installed Python version Stackless Python 3.2

The windows binary installer of PyYAML detects a 3.2 installation of Python and runs successfully.  However from the Python console if I attempt to ""import yaml"" there is a long delay and then the console restarts and nothing is imported."	anonymous
Active Tickets	212	example run-parser.c could be simplified	libyaml			defect	normal	xi	new	2011-11-16T13:30:39-05:00	2011-12-06T13:47:45-05:00	"The current parser example
  (http://pyyaml.org/browser/libyaml/branches/stable/test/run-parser.c)
contains a loop over input files that is utterly unnecessary. To explain how to use the YAML parser, one input file is enough. The loop only distracts from what should be explained."	anonymous
Active Tickets	213	improve documentation: maintainers? tutorial!	libyaml			defect	normal	xi	new	2011-11-16T16:33:51-05:00	1969-12-31T19:00:00-05:00	"The wiki page http://pyyaml.org/wiki/LibYAML is the only ""official"" documentation of libyaml, right?

Does it have any active maintainer? Who has write access? How could one qualify to get write access?

As a very simple improvement, I would suggest to provide a link to the excellent pedestrian tutorial by Andrew Poelstra, http://wpsoftware.net/andrew/pages/libyaml.html

- Joachim"	j.wuttke@…
Active Tickets	214	align map-values at dump	pyyaml			enhancement	normal	xi	new	2011-11-28T07:28:02-05:00	1969-12-31T19:00:00-05:00	"here something that aligns values of maps in vertical column (depending on longest key, or u can change the logic). it's somewhat patchwork, but works. 

{{{
#yaml_align.py
import yaml
from yaml.nodes import ScalarNode

class Dumper_MapAlignValues( object):
    'inherit + Dumper'

    #Representer.represent_mapping
    def represent_mapping(self, tag, mapping, flow_style=None):
        node = yaml.Dumper.represent_mapping( self, tag, mapping, flow_style)
        node._keywidth = 0
        if mapping:
            keys = [ k for k,v in node.value]
            simplekeys = sum( isinstance( k,ScalarNode) for k in keys) == len( node.value)
            if simplekeys:
                node._keywidth = max( len( str(k.value)) for k in keys)
        return node

    #Serializer.serialize_node
    def serialize_node(self, node, parent, index):
        if (node not in self.serialized_nodes
            and isinstance( node, ScalarNode)
            and getattr( parent, '_keywidth', None)  #mapping with _keywidth
            and index is not None   #this=value, index=key in (key,value)
            ):
                node.style = ( parent._keywidth - len( index.value ), node.style)
        return yaml.Dumper.serialize_node( self, node, parent, index)

    #Emitter.choose_scalar_style
    def choose_scalar_style(self):
        alignindent = None
        if isinstance( self.event.style, tuple):
            alignindent, self.event.style = self.event.style
        r = yaml.Dumper.choose_scalar_style( self)
        if alignindent is not None and r in ['', ""'"", '""']:
            data = ' '*alignindent
            self.column += len(data)
            if self.encoding:
                data = data.encode(self.encoding)
            self.stream.write(data)
        return r

'''usage:
class Dumper( yaml_align.Dumper_MapAlignValues, yaml.Dumper):
     pass

tt = '''
one: 1
two: 2
three: 3
four: 4
eleven: 11
'''
dd = yaml.load( tt)

print yaml.dump( dd, default_flow_style= False, Dumper= Dumper)

eleven: 11
four:   4
one:    1
three:  3
two:    2

}}}"	az@…
Active Tickets	215	Exception in yaml.dump() with Dumper and default_style=True, but not with CDumper	pyyaml			defect	normal	xi	new	2011-12-01T05:38:03-05:00	2013-04-02T12:15:13-04:00	"Hello,

I meet a reproducible Exception when dumping a python dictionary with default_style=True. This occurs when Dumper=yaml.Dumper, but not with the CDumper.

My setup:
  python-yaml, version: 3.09-5
  python2.6.6, 
  libyaml-0-2

A simple script to reproduce this exception:
-------------------------------------
#!/usr/bin/python

import yaml

str_in = """"""
test:
  a: b
""""""

d = yaml.load(str_in, Loader=yaml.Loader)

print yaml.dump(d, Dumper=yaml.CDumper)
print yaml.dump(d, Dumper=yaml.CDumper, default_style=True)
print yaml.dump(d, Dumper=yaml.Dumper)
# This line causes an exception
print yaml.dump(d, Dumper=yaml.Dumper, default_style=True)
--------------------------------
The exception is as follows:

Traceback (most recent call last):
  File ""./yamlerr.py"", line 15, in <module>
    print yaml.dump(d, Dumper=yaml.Dumper, default_style=True)
  File ""/usr/lib/python2.6/dist-packages/yaml/__init__.py"", line 175, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
  File ""/usr/lib/python2.6/dist-packages/yaml/__init__.py"", line 165, in dump_all
    dumper.represent(data)
  File ""/usr/lib/python2.6/dist-packages/yaml/representer.py"", line 34, in represent
    self.serialize(node)
  File ""/usr/lib/python2.6/dist-packages/yaml/serializer.py"", line 54, in serialize
    self.serialize_node(node, None, None)
  File ""/usr/lib/python2.6/dist-packages/yaml/serializer.py"", line 108, in serialize_node
    self.serialize_node(value, node, key)
  File ""/usr/lib/python2.6/dist-packages/yaml/serializer.py"", line 107, in serialize_node
    self.serialize_node(key, node, None)
  File ""/usr/lib/python2.6/dist-packages/yaml/serializer.py"", line 90, in serialize_node
    style=node.style))
  File ""/usr/lib/python2.6/dist-packages/yaml/emitter.py"", line 110, in emit
    self.state()
  File ""/usr/lib/python2.6/dist-packages/yaml/emitter.py"", line 389, in expect_first_block_mapping_key
    return self.expect_block_mapping_key(first=True)
  File ""/usr/lib/python2.6/dist-packages/yaml/emitter.py"", line 399, in expect_block_mapping_key
    self.expect_node(mapping=True, simple_key=True)
  File ""/usr/lib/python2.6/dist-packages/yaml/emitter.py"", line 238, in expect_node
    self.process_tag()
  File ""/usr/lib/python2.6/dist-packages/yaml/emitter.py"", line 469, in process_tag
    self.style = self.choose_scalar_style()
  File ""/usr/lib/python2.6/dist-packages/yaml/emitter.py"", line 501, in choose_scalar_style
    if self.event.style and self.event.style in '|>':
TypeError: 'in <string>' requires string as left operand, not bool
----------------------------------------------

Thanks in advance for your feedback."	sylvain
Active Tickets	216	Representer error	pyyaml			defect	normal	xi	new	2011-12-04T11:41:34-05:00	2011-12-04T11:53:37-05:00	"I think that type should reverse to exception results see code:

    def represent_unicode(self, data):
        tag = None
        try:
            data.encode('ascii')
            tag = u'tag:yaml.org,2002:python/unicode'
        except UnicodeEncodeError:
            tag = u'tag:yaml.org,2002:str'
        return self.represent_scalar(tag, data)"	anonymous
Active Tickets	229	[PATCH] pysyck cannot dump dict in 64bit system	pysyck			defect	normal	xi	new	2012-01-12T10:48:10-05:00	2012-01-17T10:22:51-05:00	"python -c 'import syck; syck.dump({1:2})

Traceback (most recent call last):
  File ""<string>"", line 1, in <module>
  File ""/usr/local/lib/python2.7/site-packages/syck/dumpers.py"", line 295, in dump
    dumper.dump(object)
  File ""/usr/local/lib/python2.7/site-packages/syck/dumpers.py"", line 23, in dump
    self.emit(self._convert(object, {}))
RuntimeError: mapping item is not marked


This is because
int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
Py_ssize_t is 64bit on my system (python 2.7, freebsd 64bit)
but you use
int dict_pos; where ""int"" is 32bit.



"	Kuang-che Wu <kcwu@…>
Active Tickets	231	problems with windows installer	pyyaml			defect	normal	xi	new	2012-01-18T06:31:55-05:00	2012-04-11T17:51:28-04:00	"PyYAML-3.10.win32-py2.6.exe will not install on my pc. The installer just crashes and windows does not issue any report.
Could it be because my pc has a 64 bit processor?

Thanks for your help,
Patrizia Paggio"	patrizia.paggio@…
Active Tickets	232	Constructor.set_python_instance_state defect with object without __setstate__ function	pyyaml			defect	normal	xi	new	2012-02-03T16:56:26-05:00	1969-12-31T19:00:00-05:00	"There is a bug in Constructor.set_python_instance_state, the last for loops of the function tries to set attribute on the object 'object' instead of the object 'instance'.

I stumbled on the bug when trying to load an object who had a __getstate__ function but no __setstate__.

The patch is straightforward, just have to replace object on line 563, by instance."	felix.antoine.fortin@…
Active Tickets	234	yaml module does not have dumps/loads functions	pyyaml			enhancement	normal	xi	new	2012-02-14T14:24:32-05:00	1969-12-31T19:00:00-05:00	Please add dumps/loads as aliases for dump/load to be more congruent w/ the json and pickle modules.	anonymous
Active Tickets	235	setup.py need better jython detection	pyyaml			defect	normal	xi	new	2012-02-27T15:27:08-05:00	2012-02-27T15:27:08-05:00	"If jython is used with openjdk then the detection in line 125 of setup.py fails.

Attached is a patch for better detection (check for 'java' in sys.platform)"	Miki Tebeka <miki.tebeka@…>
Active Tickets	237	Is \x parsing correct?	libyaml			defect	normal	xi	new	2012-03-27T12:46:14-04:00	2012-03-27T12:46:14-04:00	"The \x## parsing seems incorrect to me.  If ## is >= 0x80, the parser emits two UTF-8 characters, treating ## as a Unicode code point.

I understand \x## to mean: Insert the raw byte value ##.  I thought \u and \U are reserved for Unicode code points.
"	dfs@…
Active Tickets	238	objects which have type checks in __eq__ or __cmp__ break serialization	pyyaml			defect	normal	xi	new	2012-04-02T09:39:07-04:00	2012-04-02T09:39:07-04:00	"Python classes that raise exceptions on comparison (== operator) may break the serialization as 
[source:pyyaml/trunk/lib/yaml/representer.py@380#L142 yaml/representer.py:142] contains:
{{{
#!python
if data in [None, ()]:
}}}
It should instead read:
{{{
#!python
if data is None or data is ():
}}}
to avoid invoking the class-defined comparison operations and check for object identity instead.

This currently breaks serialization of {{{numpy.Array}}} classes."	ccx@…
Active Tickets	240	Block and / or folded literal dumps fail on trailing space	pyyaml			defect	normal	xi	new	2012-05-11T02:14:55-04:00	2012-10-25T11:21:10-04:00	"Goal:
Yaml output of both block and folded styles, such as:
folded_example: >
  I have some text here
  and then some more here.
literal_style: |
  I have some text here
  and some more here.

Approach:
Searching, I found this http://stackoverflow.com/questions/6432605  approach, which seems to work reasonably well _except_ for a peculiar data situation (""the BUG"").

PROBLEM:
If the source python dict looks like this:

>>> d = { 'x': literal_unicode('I have some text here\n and some more here.\n') }
>>> print(yaml.dump(d))
x: |
  I have some text here
   and some more here.

If the source has any trailing whitespace before the newlines (tab or spaces tested), then the output changes to this:

>>> d = { 'x': literal_unicode('I have some text here\n and some more here.\t\n') }
>>> print(yaml.dump(d))
x: ""I have some text here\n and some more here.\t\n""

Likewise for folded representation:
>>> d = { 'x': folded_unicode('I have some text here\n and some more here.\t\n') }
>>> print(yaml.dump(d))
x: ""I have some text here\n and some more here.\t\n""

>>> d = { 'x': folded_unicode('I have some text here\n and some more here.\n') }
>>> print(yaml.dump(d))
x: >
  I have some text here
   and some more here.

----
OS/X Snow Leopard;
Python Version 2.7.3
pyYaml '3.10'
"	yarkot1@…
Active Tickets	242	"ScannerError (""could not found expected ':'"") on reading map keys longer than 1024 characters"	pyyaml			defect	normal	xi	new	2012-05-17T11:39:30-04:00	2012-05-17T11:44:12-04:00	"I just got this error when reading a YAML map with a very long key:

{{{
    ""could not found expected ':'"", self.get_mark())
yaml.scanner.ScannerError: while scanning a simple key
}}}

If I delete the end of the key until it's 1024 characters long, it works.

(In this case, the keys in my map are SSH public keys for a Puppet manifest whose data I'm trying to export into YAML for easier editing.)"	ed.brannin@…
Active Tickets	243	loads_all produces an error when yaml loads classes serialization in file	pyyaml			defect	normal	xi	new	2012-05-27T14:43:41-04:00	2012-05-27T14:43:41-04:00	"Hi,

I have this code:


{{{
#!./bin/python3

import yaml

class ExcepcioTasca(Exception):

	def __init__(self, valor):
		self.value=valor

	def __str__(self):
		return repr(self.value)

class Tasca:

	def __init__(self, nombre):
		if isinstance(nombre, int):
			self.num = nombre
		else:
			self.num = None
			raise ExcepcioTasca(""S'ha passat un valor no enter com a nombre de la tasca de la instància {0}"".format(repr(self)))

	def __str__(self):
		return str(self.num)


class Enregistrador:

	def afegeix(self, tasca, fitxer='./tasques.yaml', protocol='yaml'):
		if protocol=='yaml':
			try:
				with open(fitxer, mode='a', encoding='utf-8') as f:
					yaml.dump(tasca, f)
			except TypeError as e:
				print(""No es pot enregistrar aquest tipus de dada: {0} és {1}"".format(tasca, type(tasca)))
		else:
			print(""Protocol no suportat. En futures versions, els protocols suportats poden ser XML, JSON, CSV, etc."")


def main():
	try:
		t = Tasca(3)
		print(t)
		t2 = Tasca(0)
		print(t2)
		e = Enregistrador()
		e.afegeix(t)
		e.afegeix(t2)
		e.afegeix(t)
		e.afegeix(lambda x:0)
		with open('./tasques.yaml', mode='r', encoding='utf-8') as f:
			for data in yaml.load_all(f):
				print(data)
	except ExcepcioTasca as e:
		print(""Ha ocorregut una excepció: {0}"".format(e.value))

if __name__=='__main__':
	main()

}}}


The file is called y.py

When I run y.py (python3), I receive:


{{{
$ ./y.py 
3
0
No es pot enregistrar aquest tipus de dada: <function <lambda> at 0xa29e82c> és <class 'function'>
3
Traceback (most recent call last):
  File ""./y.py"", line 57, in <module>
    main()
  File ""./y.py"", line 51, in main
    for data in yaml.load_all(f):
  File ""/home/xan/proves/xitz/simple/virtual/lib/python3.2/site-packages/yaml/__init__.py"", line 83, in load_all
    while loader.check_data():
  File ""/home/xan/proves/xitz/simple/virtual/lib/python3.2/site-packages/yaml/constructor.py"", line 26, in check_data
    return self.check_node()
  File ""/home/xan/proves/xitz/simple/virtual/lib/python3.2/site-packages/yaml/composer.py"", line 18, in check_node
    if self.check_event(StreamStartEvent):
  File ""/home/xan/proves/xitz/simple/virtual/lib/python3.2/site-packages/yaml/parser.py"", line 98, in check_event
    self.current_event = self.state()
  File ""/home/xan/proves/xitz/simple/virtual/lib/python3.2/site-packages/yaml/parser.py"", line 174, in parse_document_start
    self.peek_token().start_mark)
yaml.parser.ParserError: expected '<document start>', but found '<tag>'
  in ""./tasques.yaml"", line 2, column 1


Why I receive that? If pyyaml was able to serialize my class Tasca, then it's logic that it were able to deserialize. I don't know reasons to fail, so I report bug.

Thanks in advance,
Xan.
}}}


PS: I run ubuntu with virtualenv. So I get the lastest version of pyyaml via pypi."	xancorreu@…
Active Tickets	244	kwargs in dumper represent methods?	pyyaml			enhancement	normal	xi	new	2012-06-04T13:58:10-04:00	2012-06-04T13:58:10-04:00	"Why is it not possible to set a node's kwargs using the node factory methods found in the dumper class? This forces one to write code like:

node = dumper.represent_str(mystring)
node.style = '|'

Is there a good reason for this, am I missing something, or would this be a simple improvement of the API?"	anonymous
Active Tickets	246	scientific notation resolver bug	pyyaml			defect	normal	xi	new	2012-06-11T09:23:41-04:00	2012-06-11T09:23:41-04:00	"There is a problem with scientific notation for numbers without floating point and also without '+' or '-' after 'e'. They are resolved as strings instead of float.

{{{
>>> import yaml
>>> yaml.load('2e5')
'2e5'
}}}

Attached patch solves this problem by providing a more complex implicit float resolver.

See also: http://code.google.com/p/snakeyaml/issues/detail?id=130"	genericsoma@…
Active Tickets	249	"load() interprets ""1e-10"" as string"	pyyaml			defect	normal	xi	new	2012-06-13T07:27:36-04:00	2012-06-13T07:27:36-04:00	"The summary says it all:

The loader correctly indentifies ""1.0e-10"" as float, but fails for expressions like ""1e-10"".
Check out

   yaml.load('{value: 1e-10}')

Cheers,
Nico"	anonymous
Active Tickets	252	Sub-classing yaml.YAMLObject bypasses __init__	pyyaml			defect	normal	xi	new	2012-06-14T15:45:38-04:00	2012-06-14T15:45:38-04:00	"Hello

I really like the idea of the YAML constructor that allows you to auto-magically create class instances by simply loading YAML.

In the example shown in the documentation for constructors, the ""Monster"" class sub-classes yaml.YAMLObject and includes an __init__() method.

However, in practice the __init__() is never called. YAMLObject.from_yaml() calls the loader.construct_yaml_object() method, which directly inserts the mapping into the instance's __dict__.

So why does the example code show an __init__() method setting the attributes of the instance?

More importantly, this means that there is no way to use __init__ to define the full set of fields that are expected, and supply default values if they are missing from the YAML. So if I have a dozen YAML files, every one of them has to have the exact same set of fields, even if some or most of the files have either no value or a simple default value for one or more fields.

In my opinion, this greatly reduces the utility of this approach - but perhaps I am missing something here? 

Thanks"	ijmcfadyen@…
Active Tickets	253	Making a quiet nan results in an infinite loop on a bifferboard	pyyaml			defect	normal	xi	new	2012-06-29T11:32:45-04:00	2013-05-14T14:30:16-04:00	"I want to install ros (robot operating system) on a bifferboard running debian squeeze. I had the same problem also with lenny and ros electric. The bifferboard is a small device running a 486 compatible CPU at 140 MHz. I followed the tutorial on http://www.ros.org/wiki/fuerte/Installation/Debian and the first few steps work, but rosinstall always freezes. I can have it running for a week, and it just uses the CPU and only a small amount of memory.

Executing the following results in an infinite loop:
{{{
#rosinstall --catkin ~/ros-underlay http://ros.org/rosinstalls/fuerte-ros-base.rosinstall
}}}
When I terminate it with ctrl-c, I get the following call stack:

{{{
^CTraceback (most recent call last):
  File ""/usr/local/bin/rosinstall"", line 5, in <module>
    pkg_resources.run_script('rosinstall==0.6.17', 'rosinstall')
  File ""/usr/lib/python2.6/dist-packages/pkg_resources.py"", line 467, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File ""/usr/lib/python2.6/dist-packages/pkg_resources.py"", line 1200, in run_script
    execfile(script_filename, namespace, namespace)
  File ""/usr/local/lib/python2.6/dist-packages/rosinstall-0.6.17-py2.6.egg/EGG-INFO/scripts/rosinstall"", line 5, in <module>
    from rosinstall.rosinstall_cli import rosinstall_main
  File ""/usr/local/lib/python2.6/dist-packages/rosinstall-0.6.17-py2.6.egg/rosinstall/rosinstall_cli.py"", line 53, in <module>
    import yaml
  File ""/usr/local/lib/python2.6/dist-packages/yaml/__init__.py"", line 8, in <module>
    from loader import *
  File ""/usr/local/lib/python2.6/dist-packages/yaml/loader.py"", line 8, in <module>
    from constructor import *
  File ""/usr/local/lib/python2.6/dist-packages/yaml/constructor.py"", line 161, in <module>
    class SafeConstructor(BaseConstructor):
  File ""/usr/local/lib/python2.6/dist-packages/yaml/constructor.py"", line 257, in SafeConstructor
    inf_value *= inf_value
KeyboardInterrupt
}}}

The offending lines in /usr/local/lib/python2.6/dist-packages/yaml/constructor.py are as follows : 

{{{
        inf_value = 1e300
    while inf_value != inf_value*inf_value:
        inf_value *= inf_value
    nan_value = -inf_value/inf_value   # Trying to make a quiet NaN (like C99).
}}}

Might be because the bifferboard doesn't have an FPU?
https://sites.google.com/site/bifferboard/Home/howto/qemu

some more info that might be relevant:

{{{
# cat /proc/cpuinfo 
processor	: 0
vendor_id	: CyrixInstead
cpu family	: 4
model		: 1
model name	: Cx486SLC
stepping	: unknown
fdiv_bug	: yes
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: no
fpu_exception	: no
cpuid level	: -1
wp		: yes
flags		:
bogomips	: 49.15
clflush size	: 32
power management:

# python --version
Python 2.6.7

#python
>>> inf_value = 1e300
>>> print inf_value
1e+300
>>> print inf_value*inf_value
nan
>>> print inf_value != inf_value*inf_value
True

>>> inf_value *= inf_value
>>> print inf_value
nan
>>> print inf_value*inf_value
nan
>>> print inf_value != inf_value*inf_value
True

# apt-cache show python-yaml | grep Version
Version: 3.09-5
}}}

I'm not a pythong expert, but the above results look strange to me.
Executing it on my workstation, gives the results I would expect:

{{{
$ python --version
Python 2.7.3
$ python
>>> inf_value = 1e300
>>> print inf_value
1e+300
>>> print inf_value*inf_value
inf
>>> print inf_value != inf_value*inf_value
True
>>> inf_value *= inf_value
>>> print inf_value != inf_value*inf_value
False
}}}

Comparing the two, It looks like the bifferboard has no inf in addition to strangely handling nan. I don't know If python should handle that and how. But it might be good, if yaml prepared for such cpu's. 

I applied a quick hack, as I don't think I'll use nan or inf on that device. I don't think that's a good solution, but it's better than an infinite loop.
{{{
    inf_value = 1e300
    loop_count = 10
    while inf_value != inf_value*inf_value and loop_count > 0:
        inf_value *= inf_value
        loop_count -= 1
    nan_value = -inf_value/inf_value   # Trying to make a quiet NaN (like C99).
}}}

"	richi@…
Active Tickets	254	Errors with Numpy Dtypes	pyyaml			defect	normal	xi	new	2012-07-03T13:32:41-04:00	2012-07-03T13:32:41-04:00	"Dumping / loading numpy floats works as expected, but it seems like most of the others fail:

>>> import yaml
>>> import numpy as np
>>> yaml.load(yaml.dump(np.float64(10)))
10.0
>>> yaml.load(yaml.dump(np.int32(10)))
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/usr/local/lib/python2.7/site-packages/yaml/__init__.py"", line 202, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
  File ""/usr/local/lib/python2.7/site-packages/yaml/__init__.py"", line 190, in dump_all
    dumper.represent(data)
  File ""/usr/local/lib/python2.7/site-packages/yaml/representer.py"", line 28, in represent
    node = self.represent_data(data)
  File ""/usr/local/lib/python2.7/site-packages/yaml/representer.py"", line 61, in represent_data
    node = self.yaml_multi_representers[data_type](self, data)
  File ""/usr/local/lib/python2.7/site-packages/yaml/representer.py"", line 437, in represent_object
    return self.represent_sequence(tag+function_name, args)
  File ""/usr/local/lib/python2.7/site-packages/yaml/representer.py"", line 101, in represent_sequence
    node_item = self.represent_data(item)
  File ""/usr/local/lib/python2.7/site-packages/yaml/representer.py"", line 41, in represent_data
    if self.ignore_aliases(data):
  File ""/usr/local/lib/python2.7/site-packages/yaml/representer.py"", line 142, in ignore_aliases
    if data in [None, ()]:
TypeError: data type not understood
"	cronburg@…
Active Tickets	258	Any interest in tox and/or Travis CI for testing?	pyyaml			enhancement	normal	xi	new	2012-07-08T13:04:11-04:00	2012-07-08T14:34:00-04:00	See https://github.com/msabramo/pyyaml/tree/testing	anonymous
Active Tickets	264	yaml.load() fails to load a dict just saved by yaml.dump()	pyyaml			defect	normal	xi	new	2012-07-13T15:26:42-04:00	2012-07-13T15:26:42-04:00	PyYAML fails to load() a dict which it just saved using dump(). Fails with both Python 2.7 and 3.2, on Ubuntu Precise 64-bit.	vinay_sajip@…
Active Tickets	273	PyYAML doesn't dump python dictionary correctly if it only contains strings, numbers and/or booleans	pyyaml			defect	normal	xi	new	2012-07-27T15:57:07-04:00	1969-12-31T19:00:00-05:00	"
Here's a clear example of what's happening:
{{{
>>> mydata = {'person' : 'jesse',
...           'hobby' : 'python',
...           'employed' : True,
...           'family' : ['wife', 'toddler']}
>>> 
>>> print yaml.dump(mydata)
employed: true
family: [wife, toddler]
hobby: python
person: jesse

>>> mydata = {'person' : 'jesse',
...           'hobby' : 'python',
...           'employed' : True,
...           'family' : 'wife'}
>>> print yaml.dump(mydata)
{employed: true, family: wife, hobby: python, person: jesse}

}}}

So with a list (and probably any other object) it performs as expected, but with only strings, numbers and/or booleans it doesn't output the yaml document correctly.
"	freemind
Active Tickets	278	Cannot load __hash__able objects in mapping keys	pyyaml			defect	normal	xi	new	2012-08-08T06:26:16-04:00	2012-08-08T06:26:16-04:00	"This apparently reasonable example will fail:

{{{

import yaml

class HashableThing(yaml.YAMLObject):
    yaml_tag = u'HashableThing'

    def __init__(self, name):
        self.name = name

    def __eq__(self, other):
        return isinstance(other, type(self)) and self.name == other.name

    def __hash__(self):
        return hash(self.name)

y = yaml.dump({HashableThing('thing'): True})
print y
x = yaml.load(y)
print x
}}}

because the mapping constructor will try to hash() the object when that object has not yet been fully constructed.

The obvious thing to do would be to set deep=True on the construct_object call for mapping keys, but I'm not sure whether that's always the right thing to do. The current behaviour appears to only allow builtin types to be used as mapping keys."	asuffiel@…
Active Tickets	283	PyYaml does not create logging handler classes correctly in Python 2.7	pyyaml			defect	normal	xi	new	2012-08-11T10:23:38-04:00	2012-08-11T10:23:38-04:00	"logging.FileHandler and logging.RotatingFileHandler (haven't tried other handlers) do not get correctly initialized in python 2.7 when loaded using  PyYaml.

This example reproduces the problem:
{{{
import logging
import logging.handlers
import yaml

logger = logging.getLogger() # root logger

# Option 1 - OK
##handler = logging.handlers.RotatingFileHandler(filename = ""test.log"", maxBytes = 262144, backupCount = 3)

# Option 2 - RotatingFileHandler fails when created through yaml
handler = yaml.load(""""""
!!python/object/new:logging.handlers.RotatingFileHandler
    kwds:
        filename: test.log
        maxBytes: 262144
        backupCount: 3
"""""")

# Option 3 - FileHandler also fails when created through yaml
##handler = yaml.load(""""""
##!!python/object/new:logging.FileHandler
##    kwds:
##        filename: test.log
##"""""")

logger.addHandler(handler)

logger.warning(""test handler"")
}}}


The example above works in python 2.6 and 2.5, but fails in python 2.7. In both cases I am using the latest version of PyYaml: 3.10

I've opened a ticket in python (http://bugs.python.org/issue15616) and it seems that Logging changed from old-style classes in 2.6 to new-style classes in 2.7 and that may be the reason."	jordi.puigsegur@…
Active Tickets	284	If install prefix is not standard then package config file reports incorrect include path	libyaml			defect	normal	xi	new	2012-10-22T09:43:49-04:00	2012-10-31T02:35:37-04:00	"If install prefix is not standard then package config file reports incorrect include path

Applies to version 0.1.4"	anonymous
Active Tickets	285	List items printed as dict	pyyaml			defect	normal	xi	new	2012-10-29T14:55:22-04:00	2012-10-29T14:55:22-04:00	"There is a mistake in the dump for a list of dicts:

For example a yaml file:
{{{
treeroot:
- node: 'node'
  branch:
  - branch-2:
    - node-1: 'node-1'
      node-2: 'node-2'
}}}

After a yaml.load yaml.dump I have the following yaml file:

{{{
treeroot:
- branch:
  - branch-2:
    - {node-1: node-1, node-2: node-2}
  node: node
}}}
"	ronald.kortekaas@…
Active Tickets	286	unacceptable character #x00ba: invalid leading UTF-8 octet	pyyaml			defect	normal	xi	new	2013-01-24T05:58:44-05:00	2013-01-24T05:58:44-05:00	"PyYAML tests are failing on powerpc

running build_ext
...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.....................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.EEEEEEEEE.....................................................................................................................................................................E.EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE...................................................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
===========================================================================
test_c_parser(tests/data/emit-block-scalar-in-simple-key-context-bug.data, tests/data/emit-block-scalar-in-simple-key-context-bug.canonical): ERROR
Traceback (most recent call last):
  File ""tests/lib/test_appliance.py"", line 64, in execute
  File ""tests/lib/test_yaml_ext.py"", line 186, in test_c_parser
  File ""tests/lib/test_yaml_ext.py"", line 168, in _compare_parsers
  File ""build/lib.linux-ppc64-2.7/yaml/__init__.py"", line 36, in parse
  File ""_yaml.pyx"", line 676, in _yaml.CParser.check_event (ext/_yaml.c:7287)
  File ""_yaml.pyx"", line 530, in _yaml.CParser._parse (ext/_yaml.c:5328)
ReaderError: unacceptable character #x00ba: invalid leading UTF-8 octet
  in ""tests/data/emit-block-scalar-in-simple-key-context-bug.data"", position 22
---------------------------------------------------------------------------
tests/data/emit-block-scalar-in-simple-key-context-bug.data:
error: tests/data/emit-block-scalar-in-simple-key-context-bug.data: Too many open files


Tests are failing if libyaml-devel exists in buildroot"	k0da@…
Active Tickets	287	"Different behaviour for comment lines ending with ""-"" in YAML-Python2 and YAML-Python3"	pyyaml			defect	normal	xi	new	2013-04-07T08:01:29-04:00	2013-04-07T08:01:29-04:00	"'''If YAML-Input is:'''


{{{
# ------------
'11':
    a: aa
    b: bb
# ------------
'22':
    c: cc
    d: dd
# ------------
}}}


'''In Python-2 (2.7.3 with PyYAML-3.10.win32-py2.7) I get the result:'''

{'11': {'a': 'aa', 'b': 'bb'}, '22': {'c': 'cc', 'd': 'dd'}}

'''
In Python-3 (3.2.1 with PyYAML-3.10.win32-py3.2) the result is:'''

Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\__init__.py"", line 94, in safe_load
    return load(stream, SafeLoader)
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\__init__.py"", line 72, in load
    return loader.get_single_data()
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\constructor.py"", line 35, in get_single_data
    node = self.get_single_node()
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\composer.py"", line 36, in get_single_node
    document = self.compose_document()
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\composer.py"", line 58, in compose_document
    self.get_event()
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\parser.py"", line 118, in get_event
    self.current_event = self.state()
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\parser.py"", line 193, in parse_document_end
    token = self.peek_token()
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\scanner.py"", line 128, in peek_token
    self.fetch_more_tokens()
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\scanner.py"", line 220, in fetch_more_tokens
    return self.fetch_value()
  File ""C:\Sysware\Python3-32\lib\site-packages\yaml\scanner.py"", line 580, in fetch_value
    self.get_mark())
yaml.scanner.ScannerError: mapping values are not allowed here
  in ""C:~~E\Python2\Test\!_Allg\YAML_Daten_Test.yaml"", line 2, column 5
 

If I put another character than ""-"" at the end of the comment lines, then the Python3-YAML works well!
Perhaps there is a new interpretation of the ""-"" in the Python3-YAML-Version (continuation sign?), but I've found nothing about that in the YAML documentation.

Greetings ...
Norbert Hoyer

By the way ... YAML for Python is a great work - congratulations!"	NorHoy@…
Active Tickets	288	"Can't parse top level block scalar (""--- |\n"") without indentation"	libyaml			defect	normal	xi	new	2013-04-14T00:20:35-04:00	2013-04-14T00:20:35-04:00	"libyaml can't parse example 4.21 in YAML 1.0 spec,

{{{
--- |
Usually top level nodes are not indented.
}}}

{{{
$ ./yaml-0.1.4/tests/run-parser yaml1.0-example4.21.yaml
[1] Parsing 'yaml1.0-example4.21.yaml': FAILURE (4 events)
}}}

and also example 9.3 and 9.5 in YAML 1.2 spec.

{{{
Bare
document
...
# No document
...
|
%!PS-Adobe-2.0 # Not the first line
}}}

example 9.5 (edited version numbers)

{{{
%YAML 1.1
--- |
%!PS-Adobe-2.0
...
%YAML 1.1
---
# Empty
...
}}}

{{{
$ ./yaml-0.1.4/tests/run-parser yaml1.2-example9.3.yaml
[1] Parsing 'yaml1.2-example9.3.yaml': FAILURE (4 events)
$ ./yaml-0.1.4/tests/run-parser yaml1.2-example9.5.yaml
[1] Parsing 'yaml1.2-example9.5.yaml': FAILURE (3 events)
}}}

YAML 1.1 Example 7.9 can be parsed.

{{{
---
foo
...
# Repeated end marker.
...
---
bar
# No end marker.
---
baz
...
}}}

{{{
$ ./yaml-0.1.4/tests/run-parser yaml1.1-example7.9.yaml
[1] Parsing 'yaml1.1-example7.9.yaml': SUCCESS (11 events)
}}}

But, this fails.

{{{
--- |
foo
...
# Repeated end marker.
...
---
bar
# No end marker.
---
baz
...
}}}

{{{
$ ./yaml-0.1.4/tests/run-parser yaml1.1-example7.9-edit.yaml
[1] Parsing 'yaml1.1-example7.9-edit.yaml': FAILURE (4 events)
}}}
"	KOSEKI Kengo <koseki@…>
Active Tickets	289	Use of undefined operation to create inf & nan	pyyaml			defect	normal	xi	new	2013-04-16T03:09:36-04:00	2013-04-16T03:09:36-04:00	"In `constructor.py`, around line 256, the following lines are used to create an `inf` and a `nan`:

{{{
   inf_value = 1e300
   while inf_value != inf_value*inf_value:
       inf_value *= inf_value
   nan_value = -inf_value/inf_value   # Trying to make a quiet NaN (like C99).
}}}

The problem is that this code makes use of undefined operations. Some strict environments trap undefined operations and raise an exception, causing this code to crash the interpreter when such exceptions are not caught.

A defined way to create an `inf` and `nan` is simply:

{{{
   inf_value = float('inf')
   nan_nan = float('nan')
}}}


The latter is preferred because it will not crash the interpreter in strict environments and also its intent is clearer.
"	jstroud@…
Active Tickets	290	The linear growth of runtime of the dump function	pyyaml			defect	normal	xi	new	2013-05-08T08:44:28-04:00	2013-05-08T08:44:28-04:00	"The problem arises when using object with own implicit_resolver.
Each function invocation of dump leads to increase in the size of one of the list in the BaseResolver.yaml_implicit_resolvers dictionary. That leads to the linear growth of runtime of the dump function."	userblin@…
Active Tickets	105	remove minor code repetition	pyyaml			defect	minor	xi	new	2008-11-14T05:26:04-05:00	2008-11-14T05:26:04-05:00	"remove minor code repetition in parser (reuse self.peek_event())
{{{
Index: C:/projects/workspace_python/PyYAML_2/lib/yaml/parser.py
===================================================================
--- C:/projects/workspace_python/PyYAML_2/lib/yaml/parser.py	(revision 298)
+++ C:/projects/workspace_python/PyYAML_2/lib/yaml/parser.py	(working copy)
@@ -90,9 +90,7 @@
 
     def check_event(self, *choices):
         # Check the type of the next event.
-        if self.current_event is None:
-            if self.state:
-                self.current_event = self.state()
+        self.peek_event()
         if self.current_event is not None:
             if not choices:
                 return True

}}}"	py4fun@…
Active Tickets	106	remove unused variables	pyyaml			enhancement	minor	xi	new	2008-11-26T05:37:22-05:00	1969-12-31T19:00:00-05:00	remove unused variables in emitter, serializer, constructor to improve readability	py4fun@…
Active Tickets	110	"remove unused ""if"" statements"	pyyaml			enhancement	minor	xi	new	2008-12-19T10:10:25-05:00	2008-12-19T10:10:25-05:00	"Remove ""if"" statements which are always evaluated to the same result from resolver, scanner and serializer
{{{
Index: lib/yaml/resolver.py
===================================================================
--- lib/yaml/resolver.py	(revision 307)
+++ lib/yaml/resolver.py	(working copy)
@@ -158,7 +158,7 @@
             return self.DEFAULT_SCALAR_TAG
         elif kind is SequenceNode:
             return self.DEFAULT_SEQUENCE_TAG
-        elif kind is MappingNode:
+        else:
             return self.DEFAULT_MAPPING_TAG
 
 class Resolver(BaseResolver):
Index: lib/yaml/scanner.py
===================================================================
--- lib/yaml/scanner.py	(revision 307)
+++ lib/yaml/scanner.py	(working copy)
@@ -126,13 +126,10 @@
         # Return the next token, but do not delete if from the queue.
         while self.need_more_tokens():
             self.fetch_more_tokens()
-        if self.tokens:
-            return self.tokens[0]
+        return self.tokens[0]
 
     def get_token(self):
         # Return the next token.
-        while self.need_more_tokens():
-            self.fetch_more_tokens()
         if self.tokens:
             self.tokens_taken += 1
             return self.tokens.pop(0)
Index: lib/yaml/serializer.py
===================================================================
--- lib/yaml/serializer.py	(revision 307)
+++ lib/yaml/serializer.py	(working copy)
@@ -98,7 +98,7 @@
                     self.serialize_node(item, node, index)
                     index += 1
                 self.emit(SequenceEndEvent())
-            elif isinstance(node, MappingNode):
+            else: # MappingNode
                 implicit = (node.tag
                             == self.resolve(MappingNode, node.value, True))
                 self.emit(MappingStartEvent(alias, node.tag, implicit,

}}}"	py4fun@…
Active Tickets	153	remove reduntant code in Reader	pyyaml			enhancement	minor	xi	new	2010-01-11T18:13:24-05:00	2010-01-11T18:14:38-05:00	"Remove reduntant check:

Index: lib/yaml/reader.py
===================================================================
--- lib/yaml/reader.py	(revision 369)
+++ lib/yaml/reader.py	(working copy)
@@ -147,12 +147,8 @@
             length -= 1
 
     def get_mark(self):
-        if self.stream is None:
-            return Mark(self.name, self.index, self.line, self.column,
-                    self.buffer, self.pointer)
-        else:
-            return Mark(self.name, self.index, self.line, self.column,
-                    None, None)
+        return Mark(self.name, self.index, self.line, self.column,
+            self.buffer, self.pointer)
 
     def determine_encoding(self):
         while not self.eof and len(self.raw_buffer) < 2:
"	py4fun@…
Active Tickets	158	Require ': ' to separate keys from values in the flow context	pyyaml			enhancement	minor	xi	new	2010-03-26T10:10:48-04:00	2010-08-26T05:01:53-04:00	Please implement [http://pyyaml.org/wiki/YAMLColonInFlowContext solution 2] as it is more language-neutral.	py4fun@…
Active Tickets	220	yaml.dump indent parameter not affecting scalars in sequences	pyyaml			defect	minor	xi	new	2011-12-18T04:43:21-05:00	1969-12-31T19:00:00-05:00	"It seems that scalars in sequences aren't being affected by yaml.dump's indent parameter. This can create odd alignment mismatches when alternate indent values are used.

In python:
{{{
y = ['a', {'b':'c','d':{'e':'f','g':'h'},'i':['j','k']}, ['l', {'m':'n', 'o':'p'}, ['q','r']]]
print yaml.dump(y, default_flow_style=False, indent=4)
}}}

I expect:
{{{
-   a
-   b: c
    d:
        e: f
        g: h
    i:
    -   j
    -   k
-   -   l
    -   m: n
        o: p
    -   -   q
        -   r
}}}

Instead I get:
{{{
- a
-   b: c
    d:
        e: f
        g: h
    i:
    - j
    - k
-   - l
    -   m: n
        o: p
    -   - q
        - r
}}}"	xulfir@…
Active Tickets	114	Comments in the emitter	pyyaml			enhancement	normal	xi	new	2009-01-07T09:32:28-05:00	2012-02-29T08:04:09-05:00	"Hi,
i think there should be a way to map comments so that they can me emitted. AFAIK, at the moment there's no way to dump:
{{{
# This is a section comment
-   home: 'something'
    name: '1'
-   home: 'something else'
    name: '1'
# Other section
-   home: 'again'
[..]
}}}"	pistacchio@…
Active Tickets	165	parser.c can possibly dereference NULL pointer	libyaml			defect	normal	xi	new	2010-08-19T16:33:12-04:00	1969-12-31T19:00:00-05:00	"The following code is called in several locations in parser.c

 if (first) {
        token = PEEK_TOKEN(parser);
        if (!PUSH(parser, parser->marks, token->start_mark))
            return 0;
        SKIP_TOKEN(parser);
    }

PEEK_TOKEN is defined as
((parser->token_available || yaml_parser_fetch_more_tokens(parser)) ?       \
        parser->tokens.head : NULL)
which can return NULL. This suggests that token->start_mark could cause a segfault if token is NULL.

This is hypothetical only and the checks in PEEK_TOKEN may render the situation impossible.

Output from clang --analyze parser.c below giving line numbers. 

parser.c:733:14: warning: Dereference of null pointer
        if (!PUSH(parser, parser->marks, token->start_mark))
             ^
parser.c:733:49: note: instantiated from:
        if (!PUSH(parser, parser->marks, token->start_mark))
                                                ^
parser.c:842:14: warning: Dereference of null pointer
        if (!PUSH(parser, parser->marks, token->start_mark))
             ^
parser.c:842:49: note: instantiated from:
        if (!PUSH(parser, parser->marks, token->start_mark))
                                                ^
parser.c:959:14: warning: Dereference of null pointer
        if (!PUSH(parser, parser->marks, token->start_mark))
             ^
parser.c:959:49: note: instantiated from:
        if (!PUSH(parser, parser->marks, token->start_mark))
                                                ^
parser.c:1111:14: warning: Dereference of null pointer
        if (!PUSH(parser, parser->marks, token->start_mark))
             ^
parser.c:1111:49: note: instantiated from:
        if (!PUSH(parser, parser->marks, token->start_mark))
                                                ^
"	anonymous
Active Tickets	98	(minor) improve code readability	pyyaml			enhancement	trivial	xi	new	2008-11-05T11:41:22-05:00	2008-11-05T11:41:22-05:00	" - remove unused constructor for Node
 - remove small code repetition in Mark

both changes improve only code readability"	py4fun@…
Active Tickets	99	remove unused variable	pyyaml			defect	trivial	xi	new	2008-11-07T10:22:43-05:00	1969-12-31T19:00:00-05:00	Please remove unused 'double' variables where it is not used	py4fun@…
Active Tickets	100	remove unused variable in scaner.scan_plain_spaces()	pyyaml			enhancement	trivial	xi	new	2008-11-07T11:08:08-05:00	2008-11-07T11:08:08-05:00	remove unused variables in scanner.scan_plain_spaces() to improve readability	py4fun@…
Active Tickets	131	remove unused 'line' variable from emitter	pyyaml			enhancement	trivial	xi	new	2009-06-18T04:47:55-04:00	2009-06-18T04:47:55-04:00	remove unused 'self.line' variable from emitter	py4fun@…
Active Tickets	10	merge map doesnt work as it should ... I think	pyyaml			defect	normal	xi	assigned	2006-05-02T11:56:03-04:00	2006-05-03T14:33:20-04:00	"Hi,

It seems that the user defined directives are ignore when just after the merge key.

I have the following yml code

{{{

 Chip:
  Name: ""CHIPNAME""
  RegSize: 4
  << : !include
       file_name: ymlInclude2.yml
 

}}}

Where include is my own directive which just reads in a file

{{{

class Include(yaml.YAMLObject):
    yaml_tag = '!include'
    @classmethod
    def from_yaml(cls, constructor, node):
        # Convert the node to a dictionary
        attributes = constructor.construct_mapping(node)
        # Convert spaces into underlines
        if attributes.has_key('file_name'):
            common.log.info(""We are reading in file: "" + attributes['file_name'])
            db = loadYAMLFile(attributes['file_name'])
            # print db
            return db
        else:
            raise KeyError, ""!Include directive must have an attribute file_name""

    @classmethod
    def to_yaml(cls, representer, person):
        pass # we havent implemented this
        # Create mapping node
    def __init__(self, file_name=None):
        self.file_name = file_name

}}}


But the directive doesnt get called when I  use the merge key.
What I get when I run is this python structure.

{{{
{'Chip': 
      {'file_name': 'ymlInclude2.yml', 
       'Name': 'CHIPNAME', 'RegSize': 4}, 
'FormatVersion': 1}

}}}

So it seems that the directives are ignore when using the merge key.




"	anonymous
Active Tickets	34	Making it easier to use libyaml in PyYAML	pyyaml			defect	normal	xi	assigned	2006-10-15T08:33:17-04:00	2012-07-06T08:35:02-04:00	"I really like PyYAML with the libyaml ""plugin"".  I've been using it a lot without any troubles.  So hopefully it will make it out of alpha soon :-).  I have a couple of suggestions with respect to seamlessness between PyYAML in Python mode and PyYAML in C mode.

1. {{{yaml.load}}}'s default {{{Loader}}}.  I would suggest that this becomes {{{CLoader}}} when it is available (i.e., when {{{yaml.cyaml}}} imports successfully).

2. {{{yaml.dump}}}'s and {{{yaml.safe_dump}}}'s default {{{Dumper}}}s.  Ditto.

3. {{{Loader}}} vs. {{{CLoader}}}, {{{Dumper}}} vs. {{{CDumper}}}, {{{Emitter}}} vs. {{{CEmitter}}}, etc.   I would like a uniform way (without using {{{if}}}'s) to subclass from the C version of these classes when they are available, and otherwise the Python versions of these classes.  One possible solution:
  * Python {{{Loader}}} etc. classes get renamed to {{{PyLoader}}}, {{{PythonLoader}}}, {{{PLoader}}}, or something along those lines.
  * {{{Loader}}} becomes an alias to {{{CLoader}}} or {{{PyLoader}}}, whichever is the best available.
  * It could also be possible to control the aliases by a function call, e.g., to force them to the Python version.  Perhaps:
    {{{
def set_language(lang):
  """"""default supported languages: 'C', 'Python'""""""
  import yaml
  global Loader, Dumper, Emitter, ...
  Loader = yaml.__dict__[lang + 'Loader']
  Dumper = yaml.__dict__[lang + 'Dumper']
  Emitter = yaml.__dict__[lang + 'Emitter']
  ...
try:
  set_language('C')
except KeyError:
  set_language('Py')
}}}

Currently all of my code that imports {{{yaml}}} starts like this:

{{{
import yaml
if hasattr (yaml, 'CLoader'):
  Loader = yaml.CLoader
else:
  Loader = yaml.Loader
if hasattr (yaml, 'CDumper'):
  Dumper = yaml.CDumper
  SafeDumper = yaml.CSafeDumper
else:
  Dumper = yaml.Dumper
  SafeDumper = yaml.SafeDumper
def yaml_load (x):
  return yaml.load (x, Loader = Loader)
def yaml_dump (x):
  return yaml.dump (x, Dumper = Dumper)
def yaml_safe_dump (x):
  return yaml.dump (x, Dumper = SafeDumper)
}}}

Then I use {{{yaml_load}}} in place of {{{yaml.load}}}, {{{yaml_dump}}} in place of {{{yaml.dump}}}, and I use {{{Loader}}} etc. whenever I want to subclass.  Needless to say, it's annoying to have to repeat this in all of my projects.

Another motivation for all this, I think, is that it's not obvious out-of-the-box how to use {{{CLoader}}} and friends.  I don't think the average user should have to know about this distinction.  If libyaml is installed, it should just work (faster).

A more minor point: Once out of alpha, could we replace {{{setup.py}}} and {{{setup_with_libyaml.py}}} with a single {{{setup.py}}} that does the right thing depending on what's available in the environment?  (If PyRex is installed, I don't see why we shouldn't install, unless a command-line option tells us not to.  Or even if RyRex isn't installed, as suggested in anotehr ticket.)"	edemaine@…
Active Tickets	45	YAML-RPC	pyyaml			enhancement	normal	xi	assigned	2007-02-28T18:06:11-05:00	2007-03-20T12:42:35-04:00	"Contains a client (yamlrpclib.py), a server (SimpleYAMLRPCServer.py) and base classes for RPC communication (yamlrpcbasic.py). 

For simple testing, run the server and then the client on the same machine. Both use port 8002, but any other port is acceptable.

Caveats - See:
  
http://sourceforge.net/mailarchive/forum.php?thread_id=31728889&forum_id=1771
"	pkmurphy at postmaster dot co dot uk
Active Tickets	57	"dump(): Insert a ""blank line"" after the end of an element"	pyyaml			enhancement	normal	xi	assigned	2007-07-09T06:00:51-04:00	2008-07-29T17:14:58-04:00	"Hi, 

For readability it would be great, if you could provide an option for dump() to insert a ""blank line"" (that means a line only consisting of spaces to keep the indenting) when the indenting becomes smaller, with the option to only add this indented blank line, when the indenting goes down by at least two levels (or at least n levels). 

Thanks for creating PyYAML!"	arne_bab@…
Active Tickets	67	PySyck does not work on 64 bit machine	pysyck			defect	normal	xi	assigned	2007-10-19T16:59:07-04:00	2009-08-21T00:13:04-04:00	"Trying to use latest version of syck from CVS and PySyck from svn on the 64 bit machine.

When compiling syck regular built syck we get:
{{{
mtebeka@news01:src - 13:55 $ cd pysyck-trunk/
/home/mtebeka/src/pysyck-trunk
mtebeka@news01:pysyck-trunk - 13:55 $ rm -fr build/
mtebeka@news01:pysyck-trunk - 13:55 $ python setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.5
creating build/lib.linux-x86_64-2.5/syck
copying lib/syck/__init__.py -> build/lib.linux-x86_64-2.5/syck
copying lib/syck/dumpers.py -> build/lib.linux-x86_64-2.5/syck
copying lib/syck/loaders.py -> build/lib.linux-x86_64-2.5/syck
running build_ext
checking for syck.h
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I../syck/lib -I/usr/local/include/python2.5 -c ./_check_syck.c -o ./_check_syck.o
In file included from ../syck/lib/syck.h:39,
                 from ./_check_syck.c:2:
../syck/lib/syck_st.h:12: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:13: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:27: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:28: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:29: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:30: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:31: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:32: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:33: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:33: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:34: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:34: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:35: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:35: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:35: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:35: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:36: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:44: warning: function declaration isnât a prototype
In file included from ./_check_syck.c:2:
../syck/lib/syck.h:385: warning: function declaration isnât a prototype
../syck/lib/syck.h:412: warning: function declaration isnât a prototype
../syck/lib/syck.h:438: warning: function declaration isnât a prototype
../syck/lib/syck.h:439: warning: function declaration isnât a prototype
../syck/lib/syck.h:440: warning: function declaration isnât a prototype
checking for libsyck.a
gcc -pthread ./_check_syck.o -L../syck/lib -lsyck -o ./_check_syck
checking syck version
syck version: 0.61
building '_syck' extension
creating build/temp.linux-x86_64-2.5
creating build/temp.linux-x86_64-2.5/ext
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I../syck/lib -I/usr/local/include/python2.5 -c ext/_syckmodule.c -o build/temp.linux-x86_64-2.5/ext/_syckmodule.o
In file included from ../syck/lib/syck.h:39,
                 from ext/_syckmodule.c:3:
../syck/lib/syck_st.h:12: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:13: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:27: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:28: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:29: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:30: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:31: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:32: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:33: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:33: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:34: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:34: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:35: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:35: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:35: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:35: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:36: warning: function declaration isnât a prototype
../syck/lib/syck_st.h:44: warning: function declaration isnât a prototype
In file included from ext/_syckmodule.c:3:
../syck/lib/syck.h:385: warning: function declaration isnât a prototype
../syck/lib/syck.h:412: warning: function declaration isnât a prototype
../syck/lib/syck.h:438: warning: function declaration isnât a prototype
../syck/lib/syck.h:439: warning: function declaration isnât a prototype
../syck/lib/syck.h:440: warning: function declaration isnât a prototype
ext/_syckmodule.c: In function âPySyckEmitter_node_handlerâ:
ext/_syckmodule.c:1691: warning: passing argument 2 of âPyDict_Nextâ from incompatible pointer type
ext/_syckmodule.c:1722: warning: passing argument 3 of âPyString_AsStringAndSizeâ from incompatible pointer type
ext/_syckmodule.c: In function âPySyckEmitter_markâ:
ext/_syckmodule.c:1921: warning: passing argument 2 of âPyDict_Nextâ from incompatible pointer type
gcc -pthread -shared build/temp.linux-x86_64-2.5/ext/_syckmodule.o -L../syck/lib -lsyck -o build/lib.linux-x86_64-2.5/_syck.so
/usr/bin/ld: ../syck/lib/libsyck.a(emitter.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
../syck/lib/libsyck.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
mtebeka@news01:pysyck-trunk - 13:55 $ 
}}}

So I've compiled syck with `CFLAGS=-fPIC ./configure && make`

Then PySyck builds just fine, however:
{{{
mtebeka@news01:lib.linux-x86_64-2.5 - 13:57 $ python -c 'import syck; syck.dump(""hello"")'
Fatal Python error: PyEval_RestoreThread: NULL tstate
Aborted
mtebeka@news01:lib.linux-x86_64-2.5 - 13:57 $ 
}}}"	miki@…
Active Tickets	76	Sets are dumped with null values	pyyaml			defect	normal	xi	assigned	2008-02-16T02:42:25-05:00	2012-08-07T06:32:51-04:00	"Dumping sets looks kind of ugly. You get:

'!!set {1: null, 2: null, 3: null}'

instead of

'!!set {1, 2, 3}'

This looks even worse when each element in the set is a bit more complicated."	anonymous
Active Tickets	233	Enable libyaml be built as shared library (DLL)	libyaml			enhancement	normal	xi	assigned	2012-02-08T18:22:34-05:00	2012-02-24T15:06:03-05:00	"Hello,

Thank you for LibYAML!

I'm working on building binary packages of certain libraries to ease the installation on Windows platform.

The compiler used is GCC 4.6.x in both 32 and 64 bits (mingw and mingw-w64 projects)

At configure time, even with --enable-shared was specified, no shared library is generated.

I believe is because Windows do not support undefined symbols and libtool is not building it.

Other project (libffi) uses AM_LTLDFLAGS with -no-undefined for that purpose:

https://github.com/atgreen/libffi/blob/master/configure.ac#L101

I've tried it without success, but also I see LibYAML have undefined symbols that could affect libtool.

It will be great if next version of libyaml can be build as shared library.

Thank you."	luislavena@…
Active Tickets	72	Building libyaml with CMake	libyaml			enhancement	minor	xi	assigned	2007-12-03T08:11:04-05:00	2012-07-02T14:39:36-04:00	"I have created a [http://www.cmake.org/ cmake] ""meta-build"" file for creating project files for building libyaml.

I have tested the attached cmake file with:
 * Visual Studio 7
 * MinGW Makefiles

It should work fine with Unix Makefiles, KDevelop etc as well (I will test when I get back home in front of a linux box and add a comment here with the results).

I've uploaded the [http://usrsrc.org/svn/forks/forks/libyaml-cmake/CMakeLists.txt CMakeLists] file to my [http://usrsrc.org/svn/forks/forks/libyaml-cmake mini-libyaml branch] for the purpose of getting this working.

--
Clive Crous"	clive.crous@…
Active Tickets	16	duplicate keys in dictionary cause unpredictable behavior	pysyck			defect	major	xi	reopened	2006-05-23T14:35:35-04:00	2007-03-27T07:58:27-04:00	"When there are duplicate keys in the same dictionary, PySyck returns unpredictable results, including the wrong data type.

I'm not sure if this is a defect in PySyck, or the underlying syck library. However, older versions of PySyck (<0.55) didn't suffer from this and merely overwrote the duplicate key with the new information.

{{{
#!python
>>> syck.load('foo: bar\nfoo2: bar')
{'foo': 'bar', 'foo2': 'bar'}
>>> syck.load('foo: bar\nfoo2: bar\nfoo: bar')
[('foo', 'bar')]
}}}"	nickesk@…
Active Tickets	2	Does PySyck support python pickling	pysyck			defect	normal	xi	reopened	2006-03-31T18:37:54-05:00	2007-01-13T12:19:22-05:00	"PySyck looks very cool.

However, it would be ideal if you could pickle an object in YAML format.  In other words if a load of the yaml restored the object as an object not a dictionary.  Not sure if this functionality exists but I cannot get it to work.

--Tom"	tom.denniston@…
Active Tickets	29	Keeping mapping keys ordered	pyyaml			enhancement	normal	xi	reopened	2006-09-26T17:30:32-04:00	2011-11-28T07:14:35-05:00	"Would you be interested in adding the following kind of functionality to the public distribution of PyYAML?

{{{
>>> import yaml
>>> d = yaml.load('z: 1\ny: 2\nx: 3\n', Loader=yaml.order.OrderedLoader)
>>> d
yaml.order.odict([('z', 1), ('y', 2), ('z', 3)])
>>> for key, value in d.iteritems (): print key, value
z 1
y 2
x 3
>>> print yaml.dump(d, Dumper=yaml.order.OrderedDumper, default_flow_style=False),
z: 1
y: 2
x: 3
>>> s = yaml.dump(d, default_flow_style=False)
>>> print s,
!!omap
z: 1
y: 2
x: 3
>>> yaml.load(y)
yaml.order.odict([('z', 1), ('y', 2), ('z', 3)])
}}}

There are two things going on here:

1. Add real {{{!!omap}}} functionality.  When loading an {{{!!omap}}} object, create an odict object (defined by a new class that maintains a dictionary along with a key order), instead of the current behavior of creating a regular Python dictionary.  Conversely, when dumping such an object, preserve the key order (don't sort), and output an {{{!!omap}}} directive.  Both of these features seem quite desirable from a YAML standard point of view.

Perhaps, more generally, dumping could check for a special 'keys_in_order' attribute, in which case it follows the order of keys(), instead of sorting the keys as in the recent patch.

2. Add special {{{yaml.order.OrderedLoader}}}, which loads regular {{{!!map}}} values as if they were {{{!!omap}}} values, and {{{yaml.order.OrderedDumper}}}, which dumps {{{odict}}} types as regular {{{!!map}}} values (to avoid the ugly {{{!!omap}}} specifier).

Personally I would find this functionality very useful in many projects.  It would enable a computer program edit a human-written YAML file, without messing up all the key orders, so that the computer output looks pretty similar to what the human had just before.  I understand that YAML does not guarantee preservation of key order in a map type, or more precisely, it does not give it any significance to the order in absense of an {{{!!omap}}} or {{{!!pairs}}} type specification.  But this is a practically useful feature in some cases, so it seems natural to provide it as an optional functionality in {{{yaml.order}}}.

I'd be happy to write the code for all of this, because I need it myself.  My question is whether you'd consider including it in the PyYAML distribution."	edemaine@…
Active Tickets	91	emit no anchors and aliases	pyyaml			enhancement	normal	xi	reopened	2008-09-26T05:29:56-04:00	2012-05-24T10:27:49-04:00	"Hi, is it possible to avoid using anchors and aliases?
So to output
{{{
[1, 1]
}}}
as
{{{
- 1
- 1
}}}
and not as
{{{
- &id1 1
- *id1
}}}"	Andrey
Active Tickets	155	Cannot install PyYAML on WIndows 7 64 bit	pyyaml			defect	normal	xi	reopened	2010-02-08T18:58:55-05:00	2012-04-11T17:54:52-04:00	"I have Python 2.6 on my Windows 7 PC and just downloaded the nltk. I need to install PyYAML but I get an error:
""Python version 2.6 required, which was not found in the registry""
Any guidance is appreciated"	Alex
Active Tickets	219	A tab inside a scalar is not accepted	pyyaml			defect	normal	xi	reopened	2011-12-14T04:12:54-05:00	2011-12-19T04:43:06-05:00	"I got the exception when a tab character (\t) is located inside a scalar:
{{{
import yaml

yaml.load(""36L\tDIESEL"")
}}}
This is the output of the latest source:
{{{
  File ""C:\projects\py-workspace\pyyaml-trunk\lib\yaml\parser.py"", line 143, in parse_implicit_document_start
    StreamEndToken):
  File ""C:\projects\py-workspace\pyyaml-trunk\lib\yaml\scanner.py"", line 116, in check_token
    self.fetch_more_tokens()
  File ""C:\projects\py-workspace\pyyaml-trunk\lib\yaml\scanner.py"", line 257, in fetch_more_tokens
    % ch.encode('utf-8'), self.get_mark())
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in ""<string>"", line 1, column 4:
    36L	DIESEL
       ^
}}}
When the tab character is replaced with a space, the parser works properly.

This issue was originally reported for SnakeYAML:
http://code.google.com/p/snakeyaml/issues/detail?id=136
"	py4fun@…
