Skip to content

Compatibility Issue with AI-Generated JSON and Python-docx #1476

@181Michael

Description

@181Michael

Description

AI-generated JSON files are causing parsing issues in Python-docx.
The issue seems to stem from recursive structures generated by the AI model, which causes Python-docx to misinterpret paragraph breaks and eventually fail during parsing.

Expected Outcome

  • JSON files should be processed without parsing conflicts.
  • Python-docx should be able to recognize paragraph markers correctly.

Actual Outcome

  • Python-docx crashes during parsing.
  • Paragraph markers are misaligned, causing the document structure to break.

Reproduction Steps

  1. Generate a JSON file using an AI model (e.g., GPT).
  2. Attempt to parse the JSON data using Python-docx.
  3. Observe that parsing fails due to misaligned paragraph markers.

Technical Environment

  • Python-docx Version: [Latest stable version]
  • Python Version: [3.x.x]
  • OS: [Windows/MacOS/Linux]

Additional Notes

  • This issue might be related to how AI-generated content structures recursive markers.
  • Fixing this could improve compatibility with AI-generated data.

Supporting Materials

(If you have a sample JSON file or error log, you can attach it here.)

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