Custom Query (121 matches)
Results (22 - 24 of 121)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #137 | fixed | PROPOSED FIX:memory corruption and bad aliases | xi | cegner@… |
| Description |
Libyaml 0.1.2 fails to serialize python longs correctly. The pure python implementation produces correct output. This is a major issue for us since we make heavy use of yaml and the pure python implementation is too slow for our needs (not a criticism, just a statement of fact). I've given this 'blocker' severity and high priority since long is a basic python type. If this is inappropriate, please let me know. When is the next scheduled release of libyaml? Minimal test case: >>> import yaml
>>> from yaml import Dumper
>>> from yaml import CDumper
>>> yaml.__version__
'3.08'
>>> # libyaml doesn't have __version__ support but is 0.1.2
>>> d = { 'hourEastern': 20L, 'hour_eastern': 20L }
>>> yaml.dump( d, Dumper = CDumper )
'{hourEastern: &20 !!python/long 20, hour_eastern: *id001}\n'
>>> yaml.dump( d, Dumper = Dumper )
"{hourEastern: &id001 !!python/long '20', hour_eastern: *id001}\n"
|
|||
| #136 | invalid | Pure-python emitter fails emitting tag represented as a mapping | xi | julians@… |
| Description |
Hi, the following snippet will fail with PyYAML 3.08: #!/usr/bin/env python2.5
import yaml
Dumper = yaml.Dumper
class FooTag(yaml.YAMLObject):
yaml_dumper = Dumper
yaml_tag = u'!foo'
@classmethod
def to_yaml(cls, dumper, foo):
return dumper.represent_mapping(None,
{"foo": "bar"} )
print(yaml.dump(FooTag(), Dumper=Dumper))
The error message is: Traceback (most recent call last):
File "tag_not_specified.py", line 20, in <module>
print(yaml.dump(FooTag(), Dumper=Dumper))
File "(bogus file name)", line 175, in dump
File "(bogus file name)", line 165, in dump_all
File "yaml/representer.py", line 34, in represent
File "yaml/serializer.py", line 54, in serialize
File "yaml/serializer.py", line 109, in serialize_node
File "yaml/emitter.py", line 110, in emit
File "yaml/emitter.py", line 224, in expect_document_root
File "yaml/emitter.py", line 238, in expect_node
File "yaml/emitter.py", line 483, in process_tag
yaml.emitter.EmitterError: tag is not specified
(For some reason the file name in lines two and three of the trace is wrong, I've removed it here.) The above does work when using libyaml (try substituting CDumper). For what it's worth it will also work when to_yaml emits a scalar instead of a mapping. I've found that the following patch fixes the issue for me, but I don't understand the code well enough to know all implications of doing so. diff -ru PyYAML-3.08/lib/yaml/emitter.py PyYAML-3.08-patched/lib/yaml/emitter.py
--- PyYAML-3.08/lib/yaml/emitter.py 2008-12-31 05:24:15.000000000 +1030
+++ PyYAML-3.08-patched/lib/yaml/emitter.py 2009-07-03 13:58:11.000000000 +0930
@@ -480,7 +480,7 @@
self.prepared_tag = None
return
if tag is None:
- raise EmitterError("tag is not specified")
+ return
if self.prepared_tag is None:
self.prepared_tag = self.prepare_tag(tag)
if self.prepared_tag:
|
|||
| #135 | invalid | PyYaml 3.08 w/ python 3.1 os x | xi | jjdenis@… |
| Description |
I can not setup PyYaml? 3.08 to work with python 3.1 under os x imac:PyYAML-3.08 jjdenis$ python setup.py install running install running build running build_py creating build creating build/lib.macosx-10.5-i386-2.5 creating build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/__init__.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/composer.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/constructor.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/cyaml.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/dumper.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/emitter.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/error.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/events.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/loader.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/nodes.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/parser.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/reader.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/representer.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/resolver.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/scanner.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/serializer.py -> build/lib.macosx-10.5-i386-2.5/yaml copying lib/yaml/tokens.py -> build/lib.macosx-10.5-i386-2.5/yaml running build_ext creating build/temp.macosx-10.5-i386-2.5 checking if libyaml is compilable gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c build/temp.macosx-10.5-i386-2.5/check_libyaml.c -o build/temp.macosx-10.5-i386-2.5/check_libyaml.o unable to execute gcc: No such file or directory libyaml is not found or a compiler error: forcing --without-libyaml (if libyaml is installed correctly, you may need to specify the option --include-dirs or uncomment and modify the parameter include_dirs in setup.cfg) running install_lib running install_egg_info Removing /Library/Python/2.5/site-packages/PyYAML-3.08-py2.5.egg-info Writing /Library/Python/2.5/site-packages/PyYAML-3.08-py2.5.egg-info imac:PyYAML-3.08 jjdenis$ python3 Python 3.1 (r31:73578, Jun 27 2009, 21:49:46) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import yaml Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named yaml >>> quit() imac:PyYAML-3.08 jjdenis$ python2.5 Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import yaml >>> quit() imac:PyYAML-3.08 jjdenis$ |
|||
