Skip to content

Fails to interpret escaped double quote #325

@next-letigarcia

Description

@next-letigarcia

Hi,

I am unable to decode a valid HOCON config using pyhocon, the following is a minimal reproducible example.

This would be the equivalent JSON:

{
  "\"": "hi!"
}

As per my understanding this should be also a valid HOCON file aswell.

But this result in an error when decoding via pyhocon:

>>> from pyhocon import ConfigFactory
>>> ConfigFactory.parse_string(r'{ "\"" = "not cool bro :(" }')
Traceback (most recent call last):
  <... edited ...>
found end of text  (at char 28), (line:1, col:29)

Oddly enough, using the unicode escape sequence for the same character works:

>>> ConfigFactory.parse_string(r'{ "\u0022" = "not cool bro :(" }')
ConfigTree([('\\u0022', 'not cool bro :(')])

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions