Custom Query (121 matches)


Show under each result:

Results (55 - 57 of 121)

Ticket Resolution Summary Owner Reporter
#130 fixed Python 3.1 support? xi tom.aldenberg@…

Reported by tom.aldenberg@…, 8 years ago.


Hi, I wanted to try PyYaml? under 3.1rc2, but the installment procedure refused to recognize, or name, a directory other than Python30.

#173 invalid Python regular expression named groups breaks (?) pyyaml xi anonymous

Reported by anonymous, 7 years ago.


I'm using pyyaml 3.09 in Python 2.6.5 on Ubuntu 10.04 LTS.

I have a yaml file I used for configuration of a web server (tornado), and the section of my file causing issues looks like this:

  # [ path, handler class, [whitelist] ]
   - [/stats, myapp.core.Stats, [,]]
   - [r'/(?P<id>.*)', myapp.core.Foo, [,]]
   - [/.*, myapp.core.MainHandler, []]

When this gets loaded, pyyaml yells at me. Here's a python interpreter session:


Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml
>>> stream = open('etc/subzero.yaml')
>>> config = yaml.load(stream)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-i686/egg/yaml/", line 58, in load
  File "build/bdist.linux-i686/egg/yaml/", line 42, in get_single_data
  File "build/bdist.linux-i686/egg/yaml/", line 36, in get_single_node
  File "build/bdist.linux-i686/egg/yaml/", line 55, in compose_document
  File "build/bdist.linux-i686/egg/yaml/", line 84, in compose_node
  File "build/bdist.linux-i686/egg/yaml/", line 133, in compose_mapping_node
  File "build/bdist.linux-i686/egg/yaml/", line 82, in compose_node
  File "build/bdist.linux-i686/egg/yaml/", line 111, in compose_sequence_node
  File "build/bdist.linux-i686/egg/yaml/", line 82, in compose_node
  File "build/bdist.linux-i686/egg/yaml/", line 110, in compose_sequence_node
  File "build/bdist.linux-i686/egg/yaml/", line 93, in check_event
  File "build/bdist.linux-i686/egg/yaml/", line 479, in parse_flow_sequence_entry
yaml.parser.ParserError: while parsing a flow sequence
  in "etc/myapp.yaml", line 35, column 5
expected ',' or ']', but got '?'
  in "etc/myapp.yaml", line 35, column 10


Line 35 is:

   - [r'/(?P<id>.*)', myapp.core.Foo, [,]]

I'm wondering why it's choking here. Disabling this line causes everything to work perfectly well. The question mark is a special case in YAML, but (I thought) only when it's accompanied by a space. I don't recall ever needing to escape anything inside of a yaml file, but I tried escaping the '?'. Not sure what to try next. If I double-quote like "r'/(?P<id>.*)'" then it'll be a double-quoted string on the other end of the load as well, which doesn't help me.

Clue hereby solicited.

#179 duplicate Python-yaml crashes on unhashable key xi Samuel.Hym@…

Reported by Samuel.Hym@…, 7 years ago.



Python-yaml (debian version 3.09-5 of python-yaml, on python 2.6.6) refuses to load a yaml document containing a unhashable element as a key.

For example :

>>> yaml.load('[]: a')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/yaml/", line 58, in load
    return loader.get_single_data()
  File "/usr/lib/python2.6/dist-packages/yaml/", line 44, in get_single_data
    return self.construct_document(node)
  File "/usr/lib/python2.6/dist-packages/yaml/", line 53, in construct_document
    for dummy in generator:
  File "/usr/lib/python2.6/dist-packages/yaml/", line 403, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/usr/lib/python2.6/dist-packages/yaml/", line 213, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/usr/lib/python2.6/dist-packages/yaml/", line 137, in construct_mapping
    "found unacceptable key (%s)" % exc, key_node.start_mark)
yaml.constructor.ConstructorError: while constructing a mapping
found unacceptable key (unhashable type: 'list')
  in "<string>", line 1, column 1:
    []: a

I don't know what would be the most desirable python object to build for that kind of yaml source, though :/

Best regards

Samuel Hym

Note: See TracQuery for help on using queries.