tkrajina/gpxpy

Cannot access extensions when lxml.etree is present

Closed this issue · 1 comments

Consider this simple track and a reading code: https://gist.github.com/Zverik/03be3756fbe8e748c649e9c502f72fb3

I basically load a gpx with <extensions> and do print(point.extensions). When the lxml module is not installed, that is, gpxpy is using the built-in ElementTree, it prints an expected object reference in a list:

[<Element '{junolab.net/ms/ms_rides_routes/handlers/artifacts/models/schemas/v1/juno}TrackPointExtension' at 0x1022ee2c8>]

But with the lxml module, all I get is a dict with a weird value:

{'TrackPointExtension': '\n            '}

Tested on Python 3.7.0, gpxpy 1.1.2, lxml 4.1.1.

Oh, the reason was the old gpxpy. The extension handling appeared only in 1.3.0. I've upgraded, and the code works as expected. Sorry.