Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'NoneType' object is not subscriptable, xmlplain.xml_from_obj #3

Open
sumits99 opened this issue Jan 23, 2022 · 2 comments
Open

'NoneType' object is not subscriptable, xmlplain.xml_from_obj #3

sumits99 opened this issue Jan 23, 2022 · 2 comments

Comments

@sumits99
Copy link

dict to xml failed..
xml=xmlplain.xml_from_obj(dictionary)

Traceback (most recent call last):
File "", line 1, in
File "/Users/ssrivastava02/Desktop/scriptRepo/yaml_utils/venv/lib/python3.8/site-packages/xmlplain.py", line 556, in xml_from_obj
return xml_from_events(events, outf, encoding=encoding, process_content=process_content)
File "/Users/ssrivastava02/Desktop/scriptRepo/yaml_utils/venv/lib/python3.8/site-packages/xmlplain.py", line 275, in xml_from_events
for evt in events: generator.append(evt)
File "/Users/ssrivastava02/Desktop/scriptRepo/yaml_utils/venv/lib/python3.8/site-packages/xmlplain.py", line 231, in append
self.start[1][value[0]] = value[1]
TypeError: 'NoneType' object is not subscriptable

@6b6279
Copy link

6b6279 commented Aug 30, 2023

Hello,

I had a similar issue with an internal project using xmlplain. Turns out the XMI file, which I was using, was malformed. Check out the append function of SaxGenerator. See if there is an issue regarding the tokens expected by append. I doubt that your problem is caused directly by xmlplain.

@guillon
Copy link
Owner

guillon commented Sep 5, 2023

@sumits99 optionally, could you attach an example input (the content of your dictionnary variable, or s stripped down version) producing the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants