Skip to content
This repository was archived by the owner on Jul 14, 2021. It is now read-only.
This repository was archived by the owner on Jul 14, 2021. It is now read-only.

Input sanitization for pyYAML #5

@aliaras

Description

@aliaras

For certain tables, the outputs do not play nicely with pyYAML. In particular, there are frequently double quotes ( " ) within strings (I'm encountering that in the itemTypes table). Escaping these at this stage is hard, because there are plenty of legitimate double quotes used to indicate that the following is a string. When pyYAML encounters these quotes inside a string, it chokes and produces the following error (stack trace available if interested):

ParserError: while parsing a flow mapping
  in "invTypes.yaml", line 2, column 2139
expected ',' or '}', but got '<scalar>'
  in "invTypes.yaml", line 2, column 2256

This issue could be avoided by replacing internal quotes with their ASCII or Unicode equivalents, as suggested here: http://pyyaml.org/wiki/PyYAMLDocumentation#Scalars . Likewise, the string ":" fails for similar reasons.

There's also some HTML in these documents as well, which should probably also be stripped out (although might be harder).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions