Custom Query (121 matches)


Show under each result:

Results (61 - 63 of 121)

Ticket Resolution Summary Owner Reporter
#63 invalid % character cannot start a scalar value token xi sproaticus

Reported by sproaticus, 8 years ago.


A scalar value cannot start with a % (percent sign) character, though the YAML specification only reserves that character at the beginning of a non-indented line for directives and tags (see and ). This character should be legal as the first character of a scalar value, e.g. for Python %s-style string substitution and templates.

>>> yaml.load('yaml: %')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/PIL/", line 66, in load
  File "build/bdist.linux-i686/egg/yaml/", line 38, in get_data
  File "build/bdist.linux-i686/egg/yaml/", line 27, in get_node
  File "build/bdist.linux-i686/egg/yaml/", line 34, in compose_document
  File "build/bdist.linux-i686/egg/yaml/", line 63, in compose_node
  File "build/bdist.linux-i686/egg/yaml/", line 112, in compose_mapping_node
  File "build/bdist.linux-i686/egg/yaml/", line 43, in compose_node
  File "build/bdist.linux-i686/egg/yaml/", line 95, in check_event
  File "build/bdist.linux-i686/egg/yaml/", line 446, in parse_block_mapping_value
  File "build/bdist.linux-i686/egg/yaml/", line 116, in check_token
  File "build/bdist.linux-i686/egg/yaml/", line 257, in fetch_more_tokens
yaml.scanner.ScannerError: while scanning for the next token
found character '%' that cannot start any token
  in "<string>", line 1, column 7:
    yaml: %


  • Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
  • PyYAML-3.05-py2.5.egg
#69 invalid scalar value of escaped double-newline parsed as a single newline xi anonymous

Reported by anonymous, 8 years ago.


When parsing the following: terminator : "\n\n"

The value of the right side scalar is returned as \n, rather than \n\n. Likewise, four newlines ("\n\n\n\n") is parsed as three ("\n\n\n").

#73 invalid numpy arrays ... xi…

Reported by…, 8 years ago.


What is the best way to transfer very large numpy arrays using PyYAML?

Ideally I would like to do something like:

m = ; # a very large numpy array

y = "---\nx : '%s'\n" % (m.dumps())

z = yaml.load(y)

However, the yaml.load returns an exception:

'utf8 codec can't decode byte #x80: unexpected code byte in "<string>", position 9.

Since I have quoted the string, yaml should not be diving into it - correct?




Note: See TracQuery for help on using queries.