Skip to content

re.subs can mess up json formating. #4

@bjodah

Description

@bjodah

Hi,

thank you for making your project open source, I encountered a problem with the response no longer being valid json, I narrowed it down to this line:

filtered = re.sub(think_pattern, '', decoded, flags=re.DOTALL)

It looks like it operates on the raw json string? In my case it matched across json quoted strings, leading to errors downstream when parsing this.

If this doesn't sound quite right, then please ignore this report and perhaps close it? I reworked some of the program flow on my end, and it's no longer a 1:1 comparison between the source code I'm running and upstream, so I can't perform the same test with current main branch.

All the best,
Bjorn

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions