One function

GPXParser in tkrajina/gpxpy

The author described this change as Fix parsing bytes. It counts as a record because the check below fails on the code as it stood at f18a797c0 and passes on 1672f15d3, with nothing else changed between the two runs.

Fix saved2020-06-17
Sharing licenceApache-2.0 · LICENSE.txt
Change size+2 0

What the code was meant to do, written into the code itself as a docstring

Parse the XML and provide new GPX instance. Methods: __init__: initialize new instance init: format XML parse: parse XML, build tree, build GPX Attributes: gpx: GPX instance of the most recently parsed XML xml: string containing the XML text

The change

3636
3737 """
3838 text = xml_or_file.read() if hasattr(xml_or_file, 'read') else xml_or_file # type: ignore
39+ if isinstance(text, bytes):
40+ text = text.decode()
3941 self.xml = mod_utils.make_str(cast(str, text))
4042
4143 def parse(self, version: Optional[str]=None) -> mod_gpx.GPX:

The check that tells the two apart

failpass·test.py::GPXTests::test_parse_bytes

Check file test.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itf18a797c0fea51af5889472b7cce02de8981d1f8
Broken version dated2020-06-06
Modulegpxpy.parser
Units changedGPXParser
Fingerprint172e79c279c3a626
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.