Skip to content

Commit

Permalink
fix parsing GZ file in Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrDlouhy committed Sep 14, 2016
1 parent ecf013f commit acffdff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_gpxpy/gpx_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def parse_gpx(track):

def parse_gpx_filefield(filefield):
if filefield.name.endswith(".gz"):
track_file = gzip.open(filefield).read().decode("utf-8")
track_file = gzip.GzipFile(fileobj=filefield).read().decode("utf-8")
else:
track_file = filefield.read().decode("utf-8")
return parse_gpx(track_file)

0 comments on commit acffdff

Please sign in to comment.