Custom Query (121 matches)
Results (7 - 9 of 121)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #40 | worksforme | incomplete dict constructor | xi | dvd@… |
| Description |
Hi all, I'm puzzled by a strange behavior of yaml If you run the attached script you obtain an output like this: {'date': '732638', 'fields': {}, 'guid': '0000010f153544cf8a314808007f000000000001', 'expiration': None} {'date': '732638', 'fields': {'': {}, 'it': {'title': 'Hello World'}}, 'guid': '0000010f153544cf8a314808007f000000000001', 'expiration': None} *Please note the 'fields' value (I wrap the output to increase legibility)* the first line is printed inside this custom constructor function: def news_constructor(loader, node): nodes = loader.construct_mapping(node) print nodes return nodes the second line (the correct one) is the print of the return values of this function Can you help me or explain me this strange behavior? |
|||
| #46 | worksforme | syck.dump is not here ! | xi | jean.philippe.mague _at_ gmail _d.o.t_ com |
| Description |
when installing pysyck from syck-0.61+svn231+patches.tar.gz, I end up with a module with only the Node type and the load function (and several blah funtions). When I install it from PySyck-0.61.2.tar.gz (with syck previouly installed) every goes just fine. I use python 2.4 on a Ubuntu Edgy |
|||
| #59 | worksforme | Load yaml data as utf-8 strings into a dictionary | xi | dukebody@… |
| Description |
Hello, I'm looking for support, but I don't know if this is the right place to ask. I'm using PyYAML to load some nested data from an utf-8 encoded file in Python with: import yaml
stream=file('data.yaml','r')
data=yaml.load(stream)
The data variable becomes a dictionary with unicode values where is needed. What I want is to put utf-8 strings instead of unicode values to use this data with another library: Cheetah. If I try to use the unicode-type dictionary generated by default with PyYAML I get an UnicodeDecodeError, because de Cheetah strings are in iso-8859-15 and Python tries to decode them to Unicode using ASCII charset tables, so it obiously fails. Is there any way to get an utf-8 coded dictionary? |
|||
