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

apple health: parse error after upgrading to iOS 16 #23

Open
aperiodicchain opened this issue Nov 19, 2022 · 3 comments
Open

apple health: parse error after upgrading to iOS 16 #23

aperiodicchain opened this issue Nov 19, 2022 · 3 comments

Comments

@aperiodicchain
Copy link

aperiodicchain commented Nov 19, 2022

Upgrading to iOS 16 apparently also updated the HealthKit protocol:
HealthKit Export Version: 11 to HealthKit Export Version: 12

Parsing export.xml now throughs a parse error:

File "/.../qs_ledger/apple_health/apple-health-data-parser.py", line 118, in __init__
    self.data = ElementTree.parse(f)
File "/home/usr/.pyenv/versions/3.10.4/lib/python3.10/xml/etree/ElementTree.py", line 1229, in parse
    tree.parse(source, parser)
File "/home/usr/.pyenv/versions/3.10.4/lib/python3.10/xml/etree/ElementTree.py", line 580, in parse
    self._root = parser._parse_whole(source)
**xml.etree.ElementTree.ParseError: syntax error: line 156, column 0**

The problem has already been reported and seems to be ignored by Apple:
problem with import of XML Apple HealthKit Export Version: 12
Any thoughts on the suggested workaround with "patch.txt"?

@StevenMMortimer
Copy link

While waiting for a fix, I've been opening up the file in a text editor (BBEdit) and deleting the DTD portion of the file (first ~200 lines of the file) and haven't seen any downstream issues since, I believe, nothing is using that metadata.

@markwk
Copy link
Owner

markwk commented Jan 6, 2023

@aperiodicchain Thanks for pointing this out and posting an issue.

@StevenMMortimer Thanks for sharing a solution. I was able to follow your tip and I was able to run the notebooks by removing all of the lines between <?xml version ?> and <HealthData ..> like you see here:

Screen Shot 2023-01-06 at 15 40 09

This isn't a real fix but it does provide a workaround for anyone that gets stuck for now. These are admittedly use files to edit.

@aperiodicchain
Copy link
Author

@markwk I just got the latest iOS:, 16.2. Apple upgraded to
<!-- HealthKit Export Version: 13 --> and the issue seems to be fixed, at least for me.

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