python-openxml/python-docx

Compatibility Issue with AI-Generated JSON and Python-docx

Closed this issue · 2 comments

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.)

Hello,
I’d like to clarify that I’m not a developer myself. With @chatgpt’s guidance, I raised this issue because I noticed unexpected behavior with GPT-generated JSON files in Python-docx.
I greatly appreciate any insights or solutions the developer community can provide. Thank you for your understanding! 🙏

Dude. I have no idea what you're talking about :)

python-docx doesn't have a JSON interface so I think maybe your AI tool is hallucinating or something. You need to do your research to work out how to use python-docx and how you might want to use it for the task at hand. There is not nearly enough to go on here and I strongly suspect you're just trying to use it in a way that violates the published interface.

I recommend starting with the documentation here: https://python-docx.readthedocs.io/en/latest/

Closing as not actionable.