Custom Query (121 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (73 - 75 of 121)

Ticket Resolution Summary Owner Reporter
#59 worksforme Load yaml data as utf-8 strings into a dictionary xi dukebody@…

Reported by dukebody@…, 6 years ago.

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?

#58 wontfix Is there a way?? xi john.mcginnis@…

Reported by john.mcginnis@…, 6 years ago.

Description
a = yaml.load("""
   name: John
   number: 111
""")

print a
{'name': 'John', 'number': 111}

ok so if I do:

print yaml.dump(a) 
{name: John, number: 11}

and

print yaml.dump(a, default_flow_style=False)
name: John
number: 111

My question is, is there a variable in the code that could make the block style the default output without having to reference the style preference all the time?

#55 invalid Why can't I do "Abilities: Skills: Meele: Sword Staff"? xi arne_bab@…

Reported by arne_bab@…, 6 years ago.

Description

Why can't I use an input document containing a line like the following?

Abilities: Skills: Meele: Sword Staff

Doesn't yaml permit that?

Note: See TracQuery for help on using queries.